Hoa Nguyen has submitted this change. ( 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 <hoangu...@ucdavis.edu>
Change-Id: I0ab7b52619f2fa9495e9a6ff8d469c022eea98bc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/31994
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M tests/gem5/verifier.py
1 file changed, 4 insertions(+), 4 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/tests/gem5/verifier.py b/tests/gem5/verifier.py
index 815b9bb..ba4bd4f 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

@@ -44,7 +44,7 @@

     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: 4
Gerrit-Owner: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Hoa Nguyen <hoangu...@ucdavis.edu>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-Reviewer: mike upton <michaelup...@gmail.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to