summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabe Black <gabeblack@google.com>2017-11-27 18:59:27 -0800
committerGabe Black <gabeblack@google.com>2017-11-28 11:00:18 +0000
commit60e165116b7785bc612d8ef5c9d22af7fe84e92a (patch)
tree65680a6792bb4a2b1f558746c0e30caee8736215
parent601fa8a25c8aa2eff809a7011e9751f4bfff488a (diff)
downloadgem5-60e165116b7785bc612d8ef5c9d22af7fe84e92a.tar.xz
scons: Build GTests in the directory they're declared.
This will let us move unit tests into the directory of the code they're testing. Change-Id: I611582eb00a06a848f3ce7da89f64e42660cb844 Reviewed-on: https://gem5-review.googlesource.com/6141 Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com> Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-rwxr-xr-xsrc/SConscript6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/SConscript b/src/SConscript
index 2a495bffa..73e9f8244 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -275,6 +275,9 @@ class GTest(UnitTest):
'''Create a unit test based on the google test framework.'''
all = []
+ def __init__(self, *args, **kwargs):
+ super(GTest, self).__init__(*args, **kwargs)
+ self.dir = Dir('.')
# Children should have access
Export('Source')
@@ -1031,7 +1034,8 @@ def makeEnv(env, label, objsfx, strip=False, disable_partial=False, **kwargs):
for test in GTest.all:
test_sources = Source.all.with_tag(str(test.target))
test_objs = [ gtest_env.StaticObject(s.tnode) for s in test_sources ]
- gtest_env.Program('unittest/%s.%s' % (test.target, label), test_objs)
+ gtest_env.Program(test.dir.File('%s.%s' % (test.target, label)),
+ test_objs)
progname = exename
if strip: