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 <giacomo.travaglini@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/30216 Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com> Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user