summaryrefslogtreecommitdiff
path: root/src/SConscript
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:28 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2012-05-10 18:04:28 -0500
commit331696582f1a0e164dd6833e9eaee81559d49dff (patch)
tree58e317f4e75a21c81657e994565aa53634aadf6d /src/SConscript
parentec50c78f8311d37aa57be571be05fbb128ab8bb7 (diff)
downloadgem5-331696582f1a0e164dd6833e9eaee81559d49dff.tar.xz
stats: fix compilation of unit test.
Diffstat (limited to 'src/SConscript')
-rwxr-xr-xsrc/SConscript5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/SConscript b/src/SConscript
index fd6e725a4..c30a4fd66 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -237,7 +237,7 @@ class UnitTest(object):
'''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 @@ class UnitTest(object):
self.sources = srcs
self.target = target
+ self.main = kwargs.get('main', False)
UnitTest.all.append(self)
# Children should have access
@@ -906,6 +907,8 @@ def makeEnv(label, objsfx, strip = False, **kwargs):
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)