|
37 | 37 | from reframe.core.containers import ContainerPlatformField |
38 | 38 | from reframe.core.deferrable import _DeferredExpression |
39 | 39 | from reframe.core.exceptions import (BuildError, DependencyError, |
40 | | - PipelineError, SanityError, |
41 | | - PerformanceError) |
| 40 | + PerformanceError, PipelineError, |
| 41 | + SanityError, SkipTestError) |
42 | 42 | from reframe.core.meta import RegressionTestMeta |
43 | 43 | from reframe.core.schedulers import Job |
44 | 44 | from reframe.core.warnings import user_deprecation_warning |
@@ -603,7 +603,7 @@ def pipeline_hooks(cls): |
603 | 603 | #: |
604 | 604 | #: :: |
605 | 605 | #: |
606 | | - #: self.sanity_patterns = sn.assert_found(r'.*', self.stdout) |
| 606 | + #: self.sanity_patterns = sn.assert_true(1) |
607 | 607 | sanity_patterns = variable(_DeferredExpression, type(None), value=None) |
608 | 608 |
|
609 | 609 | #: Patterns for verifying the performance of this test. |
@@ -1294,7 +1294,8 @@ def compile_wait(self): |
1294 | 1294 |
|
1295 | 1295 | # We raise a BuildError when we an exit code and it is non zero |
1296 | 1296 | if self._build_job.exitcode: |
1297 | | - raise BuildError(self._build_job.stdout, self._build_job.stderr) |
| 1297 | + raise BuildError(self._build_job.stdout, |
| 1298 | + self._build_job.stderr, self._stagedir) |
1298 | 1299 |
|
1299 | 1300 | self.build_system.post_build(self._build_job) |
1300 | 1301 |
|
@@ -1842,6 +1843,26 @@ def getdep(self, target, environ=None, part=None): |
1842 | 1843 | raise DependencyError(f'could not resolve dependency to ({target!r}, ' |
1843 | 1844 | f'{part!r}, {environ!r})') |
1844 | 1845 |
|
| 1846 | + def skip(self, msg=None): |
| 1847 | + '''Skip test. |
| 1848 | +
|
| 1849 | + :arg msg: A message explaining why the test was skipped. |
| 1850 | +
|
| 1851 | + .. versionadded:: 3.5.1 |
| 1852 | + ''' |
| 1853 | + raise SkipTestError(msg) |
| 1854 | + |
| 1855 | + def skip_if(self, cond, msg=None): |
| 1856 | + '''Skip test if condition is true. |
| 1857 | +
|
| 1858 | + :arg cond: The condition to check for skipping the test. |
| 1859 | + :arg msg: A message explaining why the test was skipped. |
| 1860 | +
|
| 1861 | + .. versionadded:: 3.5.1 |
| 1862 | + ''' |
| 1863 | + if cond: |
| 1864 | + self.skip(msg) |
| 1865 | + |
1845 | 1866 | def __str__(self): |
1846 | 1867 | return "%s(name='%s', prefix='%s')" % (type(self).__name__, |
1847 | 1868 | self.name, self.prefix) |
|
0 commit comments