Skip to content

Commit

Permalink
SERVER-7473 Provide functionality for registering "module" tests in S…
Browse files Browse the repository at this point in the history
…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
Andy Schwerin committed Oct 31, 2012
1 parent c3c5cfb commit 2386f89
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down Expand Up @@ -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 changes: 8 additions & 0 deletions site_scons/site_tools/unittest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down Expand Up @@ -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.