summaryrefslogtreecommitdiff
path: root/tests/run.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/run.py')
-rw-r--r--tests/run.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/tests/run.py b/tests/run.py
index e4474ac5c..ae00be286 100644
--- a/tests/run.py
+++ b/tests/run.py
@@ -93,6 +93,16 @@ def require_sim_object(name, fatal=False):
else:
skip_test(msg)
+def run_test(root):
+ """Default run_test implementations. Scripts can override it."""
+
+ # instantiate configuration
+ m5.instantiate()
+
+ # simulate until program terminates
+ exit_event = m5.simulate(maxtick)
+ print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
+
# Since we're in batch mode, dont allow tcp socket connections
m5.disableAllListeners()
@@ -160,10 +170,4 @@ for sysattr in [ "system", "testsys", "drivesys" ]:
if hasattr(root, sysattr):
initCPUs(getattr(root, sysattr))
-# instantiate configuration
-m5.instantiate()
-
-# simulate until program terminates
-exit_event = m5.simulate(maxtick)
-
-print 'Exiting @ tick', m5.curTick(), 'because', exit_event.getCause()
+run_test(root)