diff options
author | Greg Studer <greg@10gen.com> | 2014-09-12 13:41:12 -0400 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2014-09-15 19:05:15 -0400 |
commit | fac5571f67e23a1339e20e0621bab0ba2a6b7163 (patch) | |
tree | 8a9691206676a8fac71c62fcc457961f0ab442e2 /site_scons/site_tools | |
parent | f526e7e49b63644456b3bc29a4a4e33406ce4b88 (diff) | |
download | mongo-fac5571f67e23a1339e20e0621bab0ba2a6b7163.tar.gz |
SERVER-1424 (re)smoke tag parsing and new test library, v0
Includes:
- Smoke.py options for filtering by jstest tags
- New resmoke.py test utility in v0 alpha
- Lots of example resmoke configurations
- SCons integration for unittests
- Sample tagged jstests
Diffstat (limited to 'site_scons/site_tools')
-rw-r--r-- | site_scons/site_tools/mongo_unittest.py (renamed from site_scons/site_tools/unittest.py) | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/site_scons/site_tools/unittest.py b/site_scons/site_tools/mongo_unittest.py index 93ce02fefac..70d66a02833 100644 --- a/site_scons/site_tools/unittest.py +++ b/site_scons/site_tools/mongo_unittest.py @@ -1,6 +1,11 @@ """Pseudo-builders for building and registering unit tests. """ +import os +import json + +from buildscripts import smoke + def exists(env): return True @@ -17,8 +22,24 @@ def unit_test_list_builder_action(env, target, source): ofile.write('%s\n' % s) finally: ofile.close() + + dir, filename = os.path.split(str(target[0])) + filebase, ext = os.path.splitext(filename) + + # Generate metadata file for unit tests + metadata_filename = os.path.join(dir, ".".join([filebase, "json"])) + print "Generating metadata file %s" % metadata_filename + + tests = [] + for s in source: + tests.append(smoke.tests.Test(filename=str(s), test_type="exe_test")) + print '\t' + str(s) + + # For now, write JSON to avoid YAML parsing dependency + smoke.tests.write_metadata(tests, metadata_filename, json_only=True) def build_cpp_unit_test(env, target, source, **kwargs): + libdeps = kwargs.get('LIBDEPS', []) libdeps.append( '$BUILD_DIR/mongo/unittest/unittest_main' ) |