tests: Add tests for the Learning gem5 scripts
authorJason Lowe-Power <power.jg@gmail.com>
Wed, 16 Sep 2015 14:35:36 +0000 (09:35 -0500)
committerJason Lowe-Power <power.jg@gmail.com>
Wed, 16 Sep 2015 14:35:36 +0000 (09:35 -0500)
These tests will ensure that Learning gem5 scripts are always up to date with
the changes in the mainline of gem5.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

tests/SConscript
tests/configs/learning-gem5-p1-simple.py [new file with mode: 0644]
tests/configs/learning-gem5-p1-two-level.py [new file with mode: 0644]
tests/quick/se/03.learning-gem5/test.py [new file with mode: 0644]

index 2f3bf0d73164b3ee2dfd4cdf69549e231e1c4288..bbd6b19500f6f51eb03a73f37728933f494b7888 100644 (file)
@@ -361,6 +361,8 @@ configs += ['simple-atomic', 'simple-atomic-mp',
             'rubytest', 'memtest', 'memtest-filter',
             'tgen-simple-mem', 'tgen-dram-ctrl']
 
+configs += ['learning-gem5-p1-simple', 'learning-gem5-p1-two-level']
+
 if env['PROTOCOL'] != 'None':
     if env['PROTOCOL'] == 'MI_example':
         configs += [c + "-ruby" for c in configs]
diff --git a/tests/configs/learning-gem5-p1-simple.py b/tests/configs/learning-gem5-p1-simple.py
new file mode 100644 (file)
index 0000000..7ee9cc8
--- /dev/null
@@ -0,0 +1,11 @@
+
+# A wrapper around configs/learning_gem5/part1/simple.py
+
+# For some reason, this is implicitly needed by run.py
+root = None
+
+def run_test(root):
+        # Called from tests/run.py
+
+        # Execute the script we are wrapping
+        execfile('configs/learning_gem5/part1/simple.py')
diff --git a/tests/configs/learning-gem5-p1-two-level.py b/tests/configs/learning-gem5-p1-two-level.py
new file mode 100644 (file)
index 0000000..caabe05
--- /dev/null
@@ -0,0 +1,24 @@
+
+# A wrapper around configs/learning_gem5/part1/two_level.py
+
+# For some reason, this is implicitly needed by run.py
+root = None
+
+import m5
+
+def run_test(root):
+        # Called from tests/run.py
+
+        # Add paths that we need
+        m5.util.addToPath('../configs/learning_gem5/part1')
+        m5.util.addToPath('../configs/common')
+
+        # The path to this script is the only parameter. Delete it so we can
+        # execute the script that we want to execute.
+        import sys
+        del sys.argv[1:]
+        # Note: at this point, we could add options we want to test.
+        # For instance, sys.argv.append('--l2_size=512kB')
+
+        # Execute the script we are wrapping
+        execfile('configs/learning_gem5/part1/two_level.py')
diff --git a/tests/quick/se/03.learning-gem5/test.py b/tests/quick/se/03.learning-gem5/test.py
new file mode 100644 (file)
index 0000000..8319279
--- /dev/null
@@ -0,0 +1,2 @@
+
+# Empty to satisfy run.py
\ No newline at end of file