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 <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
This commit is contained in:
Nikos Nikoleris
2019-06-18 11:50:24 +01:00
parent 5218914773
commit 8282b7408b
5 changed files with 51 additions and 121 deletions

View File

@@ -147,7 +147,7 @@ class Loader(object):
@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 @@ class Loader(object):
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()