changeset 37b7913d2d35 in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=37b7913d2d35
description:
stats: fix compilation of unit test.
diffstat:
src/SConscript | 5 ++++-
src/unittest/SConscript | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
diffs (41 lines):
diff -r 2972c71fccd5 -r 37b7913d2d35 src/SConscript
--- a/src/SConscript Thu May 10 18:04:28 2012 -0500
+++ b/src/SConscript Thu May 10 18:04:28 2012 -0500
@@ -237,7 +237,7 @@
'''Create a UnitTest'''
all = []
- def __init__(self, target, *sources):
+ def __init__(self, target, *sources, **kwargs):
'''Specify the target name and any sources. Sources that are
not SourceFiles are evalued with Source(). All files are
guarded with a guard of the same name as the UnitTest
@@ -252,6 +252,7 @@
self.sources = srcs
self.target = target
+ self.main = kwargs.get('main', False)
UnitTest.all.append(self)
# Children should have access
@@ -906,6 +907,8 @@
flags = { test.target : True }
test_sources = Source.get(**flags)
test_objs = [ make_obj(s, static=True) for s in test_sources ]
+ if test.main:
+ test_objs += main_objs
testname = "unittest/%s.%s" % (test.target, label)
new_env.Program(testname, test_objs + static_objs)
diff -r 2972c71fccd5 -r 37b7913d2d35 src/unittest/SConscript
--- a/src/unittest/SConscript Thu May 10 18:04:28 2012 -0500
+++ b/src/unittest/SConscript Thu May 10 18:04:28 2012 -0500
@@ -52,7 +52,7 @@
stattest_py = PySource('m5', 'stattestmain.py', skip_lib=True)
stattest_swig = SwigSource('m5.internal', 'stattest.i', skip_lib=True)
-UnitTest('stattest', 'stattest.cc', stattest_py, stattest_swig)
+UnitTest('stattest', 'stattest.cc', stattest_py, stattest_swig, main=True)
UnitTest('symtest', 'symtest.cc')
UnitTest('tokentest', 'tokentest.cc')
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev