Skip to content
Snippets Groups Projects
Commit 81bf740b authored by sbund's avatar sbund
Browse files

Better test target handling

parent 63d18fe2
No related branches found
No related tags found
No related merge requests found
...@@ -13,11 +13,13 @@ def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [ ...@@ -13,11 +13,13 @@ def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [
testEnv = env.Copy(**kw) testEnv = env.Copy(**kw)
testEnv.Append(LIBS = '$BOOSTTESTLIB') testEnv.Append(LIBS = '$BOOSTTESTLIB')
testEnv.Append(LIBS = LIBS) testEnv.Append(LIBS = LIBS)
testRunner = testEnv.Program('test', env.Object(source) + test_source) testRunner = testEnv.Program(target, env.Object(source) + test_source)
if DEPENDS: if DEPENDS:
env.Depends(testRunner, DEPENDS) env.Depends(testRunner, DEPENDS)
return env.Alias(target, env.Command(os.path.join(path,'.'+name+'.stamp'), testRunner, test = env.Command(os.path.join(path,'.'+name+'.stamp'), testRunner,
[ './$SOURCE $BOOSSTTESTARGS', 'touch $TARGET' ])) [ './$SOURCE $BOOSSTTESTARGS', 'touch $TARGET' ])
env.Alias('all_tests', test)
return env.Alias(env.File('test'), test)
def dispatcher(*arg,**kw): def dispatcher(*arg,**kw):
......
...@@ -18,4 +18,3 @@ Export('env') ...@@ -18,4 +18,3 @@ Export('env')
SConscript(glob.glob("*/SConscript")) SConscript(glob.glob("*/SConscript"))
SatSCons.StandardTargets(env) SatSCons.StandardTargets(env)
SatSCons.AllTests(env)
...@@ -105,7 +105,7 @@ def StandardObjects(env, sources, testSources = None, LIBS = []): ...@@ -105,7 +105,7 @@ def StandardObjects(env, sources, testSources = None, LIBS = []):
LIBS = [ x for x in LIBS if x not in LOCAL_LIBS ] LIBS = [ x for x in LIBS if x not in LOCAL_LIBS ]
if testSources: if testSources:
testTargets.append(env.BoostUnitTests( testTargets.append(env.BoostUnitTests(
target = 'test', target = 'test_runner',
source = sources, source = sources,
test_source = testSources + LOCAL_LIBS, test_source = testSources + LOCAL_LIBS,
LIBS = LIBS, LIBS = LIBS,
...@@ -122,7 +122,3 @@ def StandardLib(env, library, sources, testSources = None, LIBS = []): ...@@ -122,7 +122,3 @@ def StandardLib(env, library, sources, testSources = None, LIBS = []):
lib = env.Library(library,objects) lib = env.Library(library,objects)
env.Default(lib) env.Default(lib)
env.Append(**{ 'LIB_' + library : lib }) env.Append(**{ 'LIB_' + library : lib })
def AllTests(env):
tests = env.Alias('tests')
env.Depends(tests, testTargets)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment