summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authorJason Lowe-Power <jason@lowepower.com>2019-03-14 16:24:11 -0700
committerJason Lowe-Power <jason@lowepower.com>2019-03-21 15:57:10 +0000
commit76d9c83887000301f23094488ea170b0a04d1862 (patch)
treed2197f63195f434ea6b95af2d36f6e3d14d6c5c1 /ext
parent4c28149ffa5d09e6fe14952dcaf8df5d0cd8f328 (diff)
downloadgem5-76d9c83887000301f23094488ea170b0a04d1862.tar.xz
ext,tests: Add back failing exceptions
Change-Id: Idf4ba8a2a3888787abf33d1a4ac52fcf146ce732 Signed-off-by: Jason Lowe-Power <jason@lowepower.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/17452 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Diffstat (limited to 'ext')
-rw-r--r--ext/testlib/test.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/ext/testlib/test.py b/ext/testlib/test.py
index 8e2de4946..18899d6d0 100644
--- a/ext/testlib/test.py
+++ b/ext/testlib/test.py
@@ -31,6 +31,21 @@ import functools
import helper
import runner as runner_mod
+class TestingException(Exception):
+ '''Common ancestor for manual Testing Exceptions.'''
+class TestFailException(TestingException):
+ '''Signals that a test has failed.'''
+class TestSkipException(TestingException):
+ '''Signals that a test has been skipped.'''
+
+def fail(message):
+ '''Cause the current test to fail with the given message.'''
+ raise TestFailException(message)
+
+def skip(message):
+ '''Cause the current test to skip with the given message.'''
+ raise TestSkipException(message)
+
class TestCase(object):
'''
Base class for all tests.
@@ -88,4 +103,4 @@ def testfunction(function=None, name=None, fixtures=tuple()):
if function is not None:
return testfunctiondecorator(function)
else:
- return testfunctiondecorator \ No newline at end of file
+ return testfunctiondecorator