From: Giacomo Travaglini Date: Thu, 11 Jun 2020 12:21:22 +0000 (+0100) Subject: ext: Remove dead code from test_util.py X-Git-Tag: v20.1.0.0~575 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=0fb60e91f871196703169e75d552c6c58dc96888;p=gem5.git ext: Remove dead code from test_util.py JIRA: https://gem5.atlassian.net/projects/GEM5/issues/GEM5-533 Change-Id: I722185e890e25ad04271b476c4d1ffa722cade62 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30216 Maintainer: Bobby R. Bruce Tested-by: kokoro Reviewed-by: Hoa Nguyen --- diff --git a/ext/testlib/test_util.py b/ext/testlib/test_util.py index 5a0c0a8f1..22e2c973f 100644 --- a/ext/testlib/test_util.py +++ b/ext/testlib/test_util.py @@ -26,26 +26,9 @@ # # Authors: Sean Wilson -import functools - import testlib.helper as helper import testlib.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. @@ -84,23 +67,3 @@ class TestFunction(TestCase): def test(self, *args, **kwargs): self.test_function(*args, **kwargs) - -# TODO Change the decorator to make this easier to create copy tests. -# Good way to do so might be return by reference. -def testfunction(function=None, name=None, fixtures=tuple()): - ''' - A decorator used to wrap a function as a TestFunction. - ''' - def testfunctiondecorator(function): - '''Decorator used to mark a function as a test case.''' - kwargs = {} - if name is not None: - kwargs['name'] = name - if fixtures is not None: - kwargs['fixtures'] = fixtures - TestFunction(function, **kwargs) - return function - if function is not None: - return testfunctiondecorator(function) - else: - return testfunctiondecorator