Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/31994 )

Change subject: tests: fix name collisions in verifier.py
......................................................................

tests: fix name collisions in verifier.py

In verifier.py, testlib.test_util is imported and renamed to 'test',
while several functions in the file have a subfunction named 'test()',
which causes test.fail() to fail as 'test' points to the
subfunction instead of the module.

This commit addresses the above issue by keeping the imported module
as test_util instead of renaming it to test.

Signed-off-by: Hoa Nguyen <[email protected]>
Change-Id: I0ab7b52619f2fa9495e9a6ff8d469c022eea98bc
---
M tests/gem5/verifier.py
1 file changed, 5 insertions(+), 5 deletions(-)



diff --git a/tests/gem5/verifier.py b/tests/gem5/verifier.py
index 815b9bb..471d2c9 100644
--- a/tests/gem5/verifier.py
+++ b/tests/gem5/verifier.py
@@ -29,7 +29,7 @@
 '''
 import re

-from testlib import test_util as test
+from testlib import test_util
 from testlib.configuration import constants
 from testlib.helper import joinpath, diff_out_file

@@ -40,11 +40,11 @@
     def _test(self, *args, **kwargs):
         # Use a callback wrapper to make stack
         # traces easier to understand.
-        self.test(*args, **kwargs)
+        self.test_util(*args, **kwargs)

     def instantiate_test(self, name_pfx):
         name = '-'.join([name_pfx, self.__class__.__name__])
-        return test.TestFunction(self._test,
+        return test_util.TestFunction(self._test,
                 name=name, fixtures=self.fixtures)

 class MatchGoldStandard(Verifier):
@@ -80,7 +80,7 @@
                             ignore_regexes=self.ignore_regex,
                             logger=params.log)
         if diff is not None:
-            test.fail('Stdout did not match:\n%s\nSee %s for full results'
+ test_util.fail('Stdout did not match:\n%s\nSee %s for full results'
                       % (diff, tempdir))

     def _generic_instance_warning(self, kwargs):
@@ -184,7 +184,7 @@
             if parse_file(joinpath(tempdir,
                                    constants.gem5_simulation_stderr)):
                 return # Success
-        test.fail('Could not match regex.')
+        test_util.fail('Could not match regex.')

 _re_type = type(re.compile(''))
 def _iterable_regex(regex):

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/31994
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I0ab7b52619f2fa9495e9a6ff8d469c022eea98bc
Gerrit-Change-Number: 31994
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen <[email protected]>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to