Permalink
Browse files

SERVER-7473 Provide functionality for registering "module" tests in S…

…Cons.

These tests exist to facilitate writing integration tests for MongoDB modules,
and could also be used to register integration tests for core MongoDB components
that are not written as jstests or dbtests.
  • Loading branch information...
1 parent c3c5cfb commit 2386f890810afbcf3de898e92acc21cfc74a08f7 @andy10gen andy10gen committed Oct 26, 2012
Showing with 10 additions and 1 deletion.
  1. +2 −1 SConstruct
  2. +8 −0 site_scons/site_tools/unittest.py
View
@@ -286,6 +286,7 @@ env = Environment( BUILD_DIR=variantDir,
MODULE_LIBDEPS_MONGOD=[],
MODULE_LIBDEPS_MONGOS=[],
MODULE_LIBDEPS_MONGOSHELL=[],
+ MODULETEST_ALIAS='moduletests',
MODULETEST_LIST='#build/moduletests.txt',
MSVS_ARCH=msarch ,
PYTHON=utils.find_python(),
@@ -1121,4 +1122,4 @@ def clean_old_dist_builds(env, target, source):
env.Alias("dist_clean", [], [clean_old_dist_builds])
env.AlwaysBuild("dist_clean")
-env.Alias('all', ['core', 'tools', 'clientTests', 'test', 'unittests'])
+env.Alias('all', ['core', 'tools', 'clientTests', 'test', 'unittests', 'moduletests'])
@@ -8,6 +8,10 @@ def register_unit_test(env, test):
env._UnitTestList('$UNITTEST_LIST', test)
env.Alias('$UNITTEST_ALIAS', test)
+def register_module_test(env, test):
+ env._UnitTestList('$MODULETEST_LIST', test)
+ env.Alias('$MODULETEST_ALIAS', test)
+
def unit_test_list_builder_action(env, target, source):
print "Generating " + str(target[0])
ofile = open(str(target[0]), 'wb')
@@ -41,4 +45,8 @@ def generate(env):
env.Append(BUILDERS=dict(_UnitTestList=unit_test_list_builder))
env.AddMethod(register_unit_test, 'RegisterUnitTest')
env.AddMethod(build_cpp_unit_test, 'CppUnitTest')
+ env.AddMethod(register_module_test, 'RegisterModuleTest')
env.Alias('$UNITTEST_ALIAS', '$UNITTEST_LIST')
+ env.Alias('$MODULETEST_ALIAS', '$MODULETEST_LIST')
+ env.RegisterUnitTest([])
+ env.RegisterModuleTest([])

0 comments on commit 2386f89

Please sign in to comment.