changeset 2cdb85a2e980 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=2cdb85a2e980
description:
        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.sandb...@arm.com>
        Reviewed-by: Curtis Dunham <curtis.dun...@arm.com>

diffstat:

 tests/testing/tests.py |  17 +++++++++++------
 1 files changed, 11 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r e92bf392bf43 -r 2cdb85a2e980 tests/testing/tests.py
--- a/tests/testing/tests.py    Thu Sep 15 18:21:38 2016 +0100
+++ b/tests/testing/tests.py    Fri Sep 16 09:04:20 2016 +0100
@@ -236,6 +236,7 @@
     # 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 @@
         ]
 
     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(
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to