From a472d5aae5743e91738f2edd9012dea4f1db6f0e Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Sat, 3 Oct 2015 19:30:44 -0700 Subject: [PATCH] Return and run tests after building --- SConstruct | 4 +++- test/SConscript | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index 841f14c..4de5056 100644 --- a/SConstruct +++ b/SConstruct @@ -59,4 +59,6 @@ for mode in (MODE.split(',') if MODE else ['debug']): CPPPATH=[SRC_DIR]) # Get test binaries. - do_sconscript(env, TEST_DIR, out_dir.Dir('test')) + test = do_sconscript(env, TEST_DIR, out_dir.Dir('test')) + run_tests = env.Alias('test', [test], test[0].path) + env.AlwaysBuild(run_tests) diff --git a/test/SConscript b/test/SConscript index 0f6a24b..2f3afcc 100644 --- a/test/SConscript +++ b/test/SConscript @@ -26,4 +26,5 @@ for f in files: objs.append(env.Object(f)) # TODO: Add the library target for the package to test to LIBS. -env.Program('test', objs, LIBS=['gtest']) +test = env.Program('test', objs, LIBS=['gtest']) +Return('test')