summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorDavid Hows <howsdav@gmail.com>2015-04-30 15:22:03 +1000
committerDavid Hows <howsdav@gmail.com>2015-05-01 12:14:37 +1000
commit1632d07477680f48731c30a3355cee8be179383e (patch)
tree276b9ae4c2a4d250dfb999b8b954e23b76f5957b /SConstruct
parent10217fd7a79d4744359b3c81f069bb5c148d03af (diff)
downloadmongo-1632d07477680f48731c30a3355cee8be179383e.tar.gz
Move utilities to .i and add fixes for Windows
Diffstat (limited to 'SConstruct')
-rw-r--r--SConstruct134
1 files changed, 75 insertions, 59 deletions
diff --git a/SConstruct b/SConstruct
index 1d32cf05a6c..eaf1b3da00f 100644
--- a/SConstruct
+++ b/SConstruct
@@ -336,10 +336,65 @@ if GetOption("lang-python"):
shim = env.Library("window_shim",
["test/windows/windows_shim.c"])
-t = env.Program("t_bloom",
- "test/bloom/test_bloom.c",
- LIBS=[wtlib] + wtlibs)
-Default(t)
+
+
+examples = [
+ "ex_access",
+ "ex_all",
+ "ex_async",
+ "ex_call_center",
+ "ex_config",
+ "ex_config_parse",
+ "ex_cursor",
+ "ex_data_source",
+ "ex_extending",
+ "ex_hello",
+ "ex_log",
+ "ex_pack",
+ "ex_process",
+ "ex_schema",
+ "ex_scope",
+ "ex_stat",
+ "ex_thread",
+ ]
+
+# WiredTiger Smoke Test support
+# Runs each test in a custom temporary directory
+def run_smoke_test(x):
+ print "Running Smoke Test: " + x
+
+ # Make temp dir
+ temp_dir = tempfile.mkdtemp(prefix="wt_home")
+
+ try:
+ # Set WT_HOME environment variable for test
+ os.environ["WIREDTIGER_HOME"] = temp_dir
+
+ # Run the test
+ ret = subprocess.call(x);
+ if( ret != 0):
+ sys.stderr.write("Bad exit code %d\n" % (ret))
+ raise Exception()
+
+ finally:
+ # Clean directory
+ #
+ shutil.rmtree(temp_dir)
+
+def builder_smoke_test(target, source, env):
+ run_smoke_test(source[0].abspath)
+ return None
+
+env.Append(BUILDERS={'SmokeTest' : Builder(action = builder_smoke_test)})
+
+#Build the tests and setup the "scons test" target
+
+#Don't build bloom on Windows, its broken
+#t = env.Program("t_bloom",
+# "test/bloom/test_bloom.c",
+# LIBS=[wtlib] + wtlibs)
+#env.Alias("test", env.SmokeTest(t))
+#Default(t)
#env.Program("t_checkpoint",
#["test/checkpoint/checkpointer.c",
@@ -347,16 +402,25 @@ Default(t)
#"test/checkpoint/workers.c"],
#LIBS=[wtlib])
-t = env.Program("t_huge",
- "test/huge/huge.c",
- LIBS=[wtlib] + wtlibs)
-Default(t)
+#t = env.Program("t_huge",
+# "test/huge/huge.c",
+# LIBS=[wtlib] + wtlibs)
+#env.Alias("test", env.SmokeTest(t))
+#Default(t)
+
+test_util_lib = env.Library(
+ target="libtest_util",
+ source=["test/utility/test_util.c"])
+env.Append(CPPPATH=["test/utility"])
+Default(test_util_lib)
+
t = env.Program("t_fops",
["test/fops/file.c",
"test/fops/fops.c",
"test/fops/t.c"],
- LIBS=[wtlib, shim] + wtlibs)
+ LIBS=[wtlib, shim, test_util_lib] + wtlibs)
+env.Alias("test", env.SmokeTest(t))
Default(t)
if useBdb:
@@ -376,6 +440,7 @@ if useBdb:
"test/format/util.c",
"test/format/wts.c"],
LIBS=[wtlib, shim, "libdb61"] + wtlibs)
+ env.Alias("test", env.SmokeTest(t))
Default(t)
#env.Program("t_thread",
@@ -398,56 +463,7 @@ t = env.Program("wtperf", [
LIBS=[wtlib, shim] + wtlibs)
Default(t)
-examples = [
- "ex_access",
- "ex_all",
- "ex_async",
- "ex_call_center",
- "ex_config",
- "ex_config_parse",
- "ex_cursor",
- "ex_data_source",
- "ex_extending",
- "ex_hello",
- "ex_log",
- "ex_pack",
- "ex_process",
- "ex_schema",
- "ex_scope",
- "ex_stat",
- "ex_thread",
- ]
-
-# WiredTiger Smoke Test suppor
-# Runs each test in a custom temporary directory
-#
-def run_smoke_test(x):
- print "Running Smoke Test: " + x
-
- # Make temp dir
- temp_dir = tempfile.mkdtemp(prefix="wt_home")
-
- try:
- # Set WT_HOME environment variable for test
- os.environ["WIREDTIGER_HOME"] = temp_dir
-
- # Run the test
- ret = subprocess.call(x);
- if( ret != 0):
- sys.stderr.write("Bad exit code %d\n" % (ret))
- raise Exception()
-
- finally:
- # Clean directory
- #
- shutil.rmtree(temp_dir)
-
-def builder_smoke_test(target, source, env):
- run_smoke_test(source[0].abspath)
- return None
-
-env.Append(BUILDERS={'SmokeTest' : Builder(action = builder_smoke_test)})
-
+#Build the Examples
for ex in examples:
if(ex in ['ex_all', 'ex_async', 'ex_thread']):
exp = env.Program(ex, "examples/c/" + ex + ".c", LIBS=[wtlib, shim] + wtlibs)