diff options
author | Greg Studer <greg@10gen.com> | 2014-09-12 13:41:12 -0400 |
---|---|---|
committer | Greg Studer <greg@10gen.com> | 2014-09-18 14:37:45 -0400 |
commit | e88273ac940cdef9e12c94a6bdbd2694b706a635 (patch) | |
tree | 76ca1becd98156bd852adc67f4262b0a4d176826 /site_scons | |
parent | 9ad364efb8bfd01d5653a8d085e23c70a0dcfb29 (diff) | |
download | mongo-e88273ac940cdef9e12c94a6bdbd2694b706a635.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')
-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' ) |