Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions reframe/core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -2605,8 +2605,18 @@ class CompileOnlyRegressionTest(RegressionTest, special=True):
The standard output and standard error of the test will be set to those of
the compilation stage.

Compile-only tests do not need to define a sanity checking function, since
the compile stage will always fail if the compilation fails.
However, if a sanity function is defined, it will be used to validate the
test.

This class is also directly available under the top-level :mod:`reframe`
module.

.. versionchanged:: 4.6

Compile-only tests do not require an explicit sanity checking function.

'''

_rfm_regression_class_kind = _RFM_TEST_KIND_COMPILE
Expand Down Expand Up @@ -2646,3 +2656,11 @@ def run_wait(self):

Implemented as no-op
'''

def check_sanity(self):
# If no sanity function is defined, then use an identity expression
if (not hasattr(self, '_rfm_sanity') and
not hasattr(self, 'sanity_patterns')):
self.sanity_patterns = sn.assert_true(1)

super().check_sanity()
4 changes: 0 additions & 4 deletions unittests/resources/checks/hellocheck.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ class CompileOnlyHelloTest(rfm.CompileOnlyRegressionTest):
valid_prog_environs = ['*']
sourcepath = 'hello.c'

@sanity_function
def validate(self):
return sn.assert_not_found(r'(?i)error', self.stdout)


@rfm.simple_test
class SkipTest(rfm.RunOnlyRegressionTest):
Expand Down