Skip to content

Instantly share code, notes, and snippets.

@jgphpc
Created January 30, 2020 17:17
Show Gist options
  • Save jgphpc/11fc212945ef1beb7e44c2998afe1e25 to your computer and use it in GitHub Desktop.
Save jgphpc/11fc212945ef1beb7e44c2998afe1e25 to your computer and use it in GitHub Desktop.
import os, sys
import reframe as rfm
import reframe.utility.sanity as sn
@rfm.simple_test
class ExampleRunOnlyTest(rfm.RunOnlyRegressionTest):
def __init__(self):
self.descr = ('RunOnlyRegressionTest')
self.valid_systems = ['dom:login']
self.valid_prog_environs = ['PrgEnv-cray']
self.sourcesdir = None
self.executable = 'echo 9.c'
self.sanity_patterns = sn.all([
sn.assert_found('9', self.stdout),
])
self.perf_patterns = {
'elapsed_time': self.elapsed,
'filename': self.fnm,
}
self.reference = {
'*': {
'elapsed_time': (0, None, None, 's'),
'filename': (0, None, None, ''),
}
}
self.maintainers = ['x']
self.tags = {'tutorial'}
@property
@sn.sanity_function
def elapsed(self):
return 8
@property
@sn.sanity_function
def fnm(self):
regex = r'(?P<fn>.*)'
result = sn.extractsingle(regex, self.stdout, 'fn')
return result
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment