summaryrefslogtreecommitdiff
path: root/site_scons
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2012-06-13 14:34:36 -0400
committerEliot Horowitz <eliot@10gen.com>2012-06-13 15:24:31 -0400
commitbe32f9f467972ffd2e9f37e244c09f88d354faf0 (patch)
treeb13a07fd43e0651443a4a95dc5116ad096b8520d /site_scons
parent002f57193d41f0b8499245958653aa599699b93d (diff)
downloadmongo-be32f9f467972ffd2e9f37e244c09f88d354faf0.tar.gz
add NO_CRUTCH option for CppUnit tests
Diffstat (limited to 'site_scons')
-rw-r--r--site_scons/site_tools/unittest.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/site_scons/site_tools/unittest.py b/site_scons/site_tools/unittest.py
index 0ce0ae582c1..81462d4483c 100644
--- a/site_scons/site_tools/unittest.py
+++ b/site_scons/site_tools/unittest.py
@@ -19,8 +19,18 @@ def unit_test_list_builder_action(env, target, source):
ofile.close()
def build_cpp_unit_test(env, target, source, **kwargs):
- kwargs['LIBDEPS'] = kwargs.get('LIBDEPS', []) + ['$BUILD_DIR/mongo/unittest/unittest_main',
- '$BUILD_DIR/mongo/unittest/unittest_crutch']
+ libdeps = kwargs.get('LIBDEPS', [])
+ libdeps.append( '$BUILD_DIR/mongo/unittest/unittest_main' )
+
+ includeCrutch = True
+ if "NO_CRUTCH" in kwargs:
+ includeCrutch = not kwargs["NO_CRUTCH"]
+
+ if includeCrutch:
+ libdeps.append( '$BUILD_DIR/mongo/unittest/unittest_crutch' )
+
+ kwargs['LIBDEPS'] = libdeps
+
result = env.Program(target, source, **kwargs)
env.RegisterUnitTest(result[0])
return result