diff options
author | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-09-16 09:04:20 +0100 |
---|---|---|
committer | Andreas Sandberg <andreas.sandberg@arm.com> | 2016-09-16 09:04:20 +0100 |
commit | 1ecc3628a8fe24d8ed189ee23ca41f2b385b3d8e (patch) | |
tree | 775107e244c324975768d8f85e1ad0018d3a4ce7 /tests | |
parent | 18461d1522821495813b342b50ca3c69e8db2083 (diff) | |
download | gem5-1ecc3628a8fe24d8ed189ee23ca41f2b385b3d8e.tar.xz |
tests: Add support for functional only tests
Modify the ClassicTest class to only emit a stat verification test
unit if there is a reference stat file. This makes it possible to
design tests that don't care about stat changes.
To generate purely functional tests, we need to be able to create
empty test reference directories. This does not work well with many
revision control systems. As a workaround, add a file named EMPTY to
the list of ignored files in the test harness. This file can be used
as a placeholder in otherwise empty test directories.
Change-Id: I583c8c4e55479f0d48fa99d0b0d1eac9221e6652
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Curtis Dunham <curtis.dunham@arm.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testing/tests.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tests/testing/tests.py b/tests/testing/tests.py index 48e034bba..6f887ff80 100644 --- a/tests/testing/tests.py +++ b/tests/testing/tests.py @@ -236,6 +236,7 @@ class ClassicTest(Test): # and other files that we don't care about. ref_ignore_files = FileIgnoreList( names=( + "EMPTY", ), rex=( # Mercurial sometimes leaves backups when applying MQ patches r"\.orig$", @@ -284,17 +285,21 @@ class ClassicTest(Test): ] def verify_units(self): - return [ - DiffStatFile(ref_dir=self.ref_dir, test_dir=self.output_dir, - skip=self.skip_diff_stat) - ] + [ + ref_files = set(self.ref_files()) + units = [] + if "stats.txt" in ref_files: + units.append( + DiffStatFile(ref_dir=self.ref_dir, test_dir=self.output_dir, + skip=self.skip_diff_stat)) + units += [ DiffOutFile(f, ref_dir=self.ref_dir, test_dir=self.output_dir, skip=self.skip_diff_out) - for f in self.ref_files() - if f not in ClassicTest.diff_ignore_files + for f in ref_files if f not in ClassicTest.diff_ignore_files ] + return units + def update_ref(self): for fname in self.ref_files(): shutil.copy( |