[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Nikos Nikoleris has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/19251 ) Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Gem5Fixture is used to define a fixture for building the gem5 binary. Most tests are expected to define their own Gem5Fixture, however, as some might depend on the same binary (e.g., ./build/ARM/gem5.opt), they will try to re-define a fixture for the same target. This patchset changes Gem5Fixture to derive from UniqueFixture. In addition, this patchset changes the way global fixtures are discovered to work with the new Gem5Fixture class. Instead of enumerating them when test definitions are loaded, we do so after the tests have been filtered according to specified tags (e.g., include opt variant, exclude fast, debug variants). Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19251 Tested-by: kokoro Reviewed-by: Giacomo Travaglini Maintainer: Giacomo Travaglini --- M ext/testlib/fixture.py M ext/testlib/loader.py M ext/testlib/main.py M ext/testlib/wrappers.py M tests/gem5/fixture.py 5 files changed, 51 insertions(+), 121 deletions(-) Approvals: Giacomo Travaglini: Looks good to me, approved; Looks good to me, approved kokoro: Regressions pass diff --git a/ext/testlib/fixture.py b/ext/testlib/fixture.py index be89244..7af6cb2 100644 --- a/ext/testlib/fixture.py +++ b/ext/testlib/fixture.py @@ -32,8 +32,6 @@ import helper import log -global_fixtures = [] - class SkipException(Exception): def __init__(self, fixture, testitem): self.fixture = fixture @@ -71,21 +69,11 @@ if name is None: name = self.__class__.__name__ self.name = name +self._is_global = False def skip(self, testitem): raise SkipException(self.name, testitem.metadata) -def schedule_finalized(self, schedule): -''' -This method is called once the schedule of for tests is known. -To enable tests to use the same fixture defintion for each execution -fixtures must return a copy of themselves in this method. - -:returns: a copy of this fixture which will be setup/torndown - when the test item this object is tied to is about to execute. -''' -return self.copy() - def init(self, *args, **kwargs): pass @@ -95,9 +83,6 @@ def teardown(self, testitem): pass -def copy(self): -return copy.deepcopy(self) - def skip_cleanup(self): ''' If this method is called, then we should make sure that nothing is @@ -105,11 +90,8 @@ ''' pass +def set_global(self): +self._is_global = True -def globalfixture(fixture): -''' -Store the given fixture as a global fixture. Its setup() method -will be called before the first test is executed. -''' -global_fixtures.append(fixture) -return fixture +def is_global(self): +return self._is_global diff --git a/ext/testlib/loader.py b/ext/testlib/loader.py index e788c33..8f8f60e 100644 --- a/ext/testlib/loader.py +++ b/ext/testlib/loader.py @@ -147,7 +147,7 @@ @property def schedule(self): -return wrappers.LoadedLibrary(self.suites, fixture_mod.global_fixtures) +return wrappers.LoadedLibrary(self.suites) def load_schedule_for_suites(self, *uids): files = {uid.UID.uid_to_path(id_) for id_ in uids} @@ -155,8 +155,7 @@ self.load_file(file_) return wrappers.LoadedLibrary( -[self.suite_uids[id_] for id_ in uids], -fixture_mod.global_fixtures) +[self.suite_uids[id_] for id_ in uids]) def _verify_no_duplicate_suites(self, new_suites): new_suite_uids = self.suite_uids.copy() diff --git a/ext/testlib/main.py b/ext/testlib/main.py index ac79547..cbba000 100644 --- a/ext/testlib/main.py +++ b/ext/testlib/main.py @@ -254,20 +254,6 @@ log_handler.schedule_finalized(test_schedule) -# Iterate through all fixtures notifying them of the test schedule. -for suite in test_schedule: -copied_fixtures = [] -for fixture in suite.fixtures: - copied_fixtures.append(fixture.schedule_finalized(test_schedule)) -suite.fixtures = copied_fixtures - -for test in suite: -copied_fixtures = [] -for fixture in test.fixtures: -copied_fixtures.append(fixture.schedule_finalized( -test_schedule)) -test.fixtures = copied_fixtures - log.test_log.message(terminal.separator()) log.test_log.message('Running Tests from {} suites' .format(len(test_schedule.suites)), bold=True) diff --git a/ext/testlib/wrappers.py
[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Hello kokoro, Ciro Santilli, Giacomo Travaglini, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 to look at the new patch set (#10). Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Gem5Fixture is used to define a fixture for building the gem5 binary. Most tests are expected to define their own Gem5Fixture, however, as some might depend on the same binary (e.g., ./build/ARM/gem5.opt), they will try to re-define a fixture for the same target. This patchset changes Gem5Fixture to derive from UniqueFixture. In addition, this patchset changes the way global fixtures are discovered to work with the new Gem5Fixture class. Instead of enumerating them when test definitions are loaded, we do so after the tests have been filtered according to specified tags (e.g., include opt variant, exclude fast, debug variants). Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb --- M ext/testlib/fixture.py M ext/testlib/loader.py M ext/testlib/main.py M ext/testlib/wrappers.py M tests/gem5/fixture.py 5 files changed, 51 insertions(+), 121 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Gerrit-Change-Number: 19251 Gerrit-PatchSet: 10 Gerrit-Owner: Nikos Nikoleris Gerrit-Assignee: Jason Lowe-Power Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Nikos Nikoleris Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Hello kokoro, Ciro Santilli, Giacomo Travaglini, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 to look at the new patch set (#9). Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb --- M ext/testlib/fixture.py M ext/testlib/loader.py M ext/testlib/main.py M ext/testlib/wrappers.py M tests/gem5/fixture.py 5 files changed, 51 insertions(+), 121 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Gerrit-Change-Number: 19251 Gerrit-PatchSet: 9 Gerrit-Owner: Nikos Nikoleris Gerrit-Assignee: Jason Lowe-Power Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Nikos Nikoleris Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Hello kokoro, Ciro Santilli, Giacomo Travaglini, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 to look at the new patch set (#8). Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb --- M ext/testlib/fixture.py M ext/testlib/loader.py M ext/testlib/main.py M ext/testlib/wrappers.py M tests/gem5/fixture.py 5 files changed, 50 insertions(+), 119 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Gerrit-Change-Number: 19251 Gerrit-PatchSet: 8 Gerrit-Owner: Nikos Nikoleris Gerrit-Assignee: Jason Lowe-Power Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Nikos Nikoleris Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Hello kokoro, Ciro Santilli, Giacomo Travaglini, Jason Lowe-Power, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 to look at the new patch set (#6). Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb --- M ext/testlib/fixture.py M ext/testlib/main.py M tests/gem5/fixture.py 3 files changed, 24 insertions(+), 98 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Gerrit-Change-Number: 19251 Gerrit-PatchSet: 6 Gerrit-Owner: Nikos Nikoleris Gerrit-Assignee: Jason Lowe-Power Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Jason Lowe-Power Gerrit-Reviewer: Nikos Nikoleris Gerrit-Reviewer: kokoro Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Hello kokoro, Ciro Santilli, Giacomo Travaglini, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 to look at the new patch set (#4). Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb --- M ext/testlib/fixture.py M ext/testlib/main.py M tests/gem5/fixture.py 3 files changed, 20 insertions(+), 97 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Gerrit-Change-Number: 19251 Gerrit-PatchSet: 4 Gerrit-Owner: Nikos Nikoleris Gerrit-Assignee: Jason Lowe-Power Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Nikos Nikoleris Gerrit-Reviewer: kokoro Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev
[gem5-dev] Change in gem5/gem5[master]: tests: Refactor the Gem5Fixture to derive from UniqueFixture
Hello kokoro, Ciro Santilli, Giacomo Travaglini, I'd like you to reexamine a change. Please visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 to look at the new patch set (#3). Change subject: tests: Refactor the Gem5Fixture to derive from UniqueFixture .. tests: Refactor the Gem5Fixture to derive from UniqueFixture Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb --- M ext/testlib/fixture.py M ext/testlib/main.py M tests/gem5/fixture.py 3 files changed, 20 insertions(+), 97 deletions(-) -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19251 To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: master Gerrit-Change-Id: Ie868a7e18ef6c3271f3c8a658229657cd43997cb Gerrit-Change-Number: 19251 Gerrit-PatchSet: 3 Gerrit-Owner: Nikos Nikoleris Gerrit-Assignee: Jason Lowe-Power Gerrit-Reviewer: Ciro Santilli Gerrit-Reviewer: Giacomo Travaglini Gerrit-Reviewer: Nikos Nikoleris Gerrit-Reviewer: kokoro Gerrit-CC: Jason Lowe-Power Gerrit-MessageType: newpatchset ___ gem5-dev mailing list gem5-dev@gem5.org http://m5sim.org/mailman/listinfo/gem5-dev