diff --git a/satscons/BoostUnitTests.py b/satscons/BoostUnitTests.py index 78d399ad3b68188bd2eb1d76d0bf4886c5af6b57..27e5154aeb0b3b6d5f7fa5b86a2a5b7b52dd8b65 100644 --- a/satscons/BoostUnitTests.py +++ b/satscons/BoostUnitTests.py @@ -16,11 +16,8 @@ def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [ testRunner = testEnv.Program(target, env.Object(source) + test_source) if DEPENDS: env.Depends(testRunner, DEPENDS) - test = env.Command(os.path.join(path,'.'+name+'.stamp'), testRunner, - [ './$SOURCE $BOOSSTTESTARGS', 'touch $TARGET' ]) - env.Alias('all_tests', test) - return env.Alias(env.File('test'), test) - + return env.Command(os.path.join(path,'.'+name+'.stamp'), testRunner, + [ './$SOURCE $BOOSSTTESTARGS', 'touch $TARGET' ]) def dispatcher(*arg,**kw): return BoostUnitTests(*arg,**kw) diff --git a/satscons/SatSCons.py b/satscons/SatSCons.py index 7c8ea5b8c54dd2fcb5f15bf750433be030ee1e7b..c3327f4d59ad2ba8bc5bf4db89593ece5e117d2a 100644 --- a/satscons/SatSCons.py +++ b/satscons/SatSCons.py @@ -3,8 +3,6 @@ import os.path, SCons.Options, SCons.Environment, SCons.Script.SConscript, glob opts = None finalizers = [] -testTargets = [] - def InitOpts(): global opts if opts is not None: return @@ -92,7 +90,6 @@ def StandardTargets(env): #env.AlwaysBuild(env.Command('ChangeLog', '', [ "cvs2cl -rS --no-wrap --summary" ])) def StandardObjects(env, sources, testSources = None, LIBS = []): - global testTargets if type(sources) == type(()): testSources = sources[1] sources = sources[0] @@ -101,19 +98,21 @@ def StandardObjects(env, sources, testSources = None, LIBS = []): objects = env.Object(sources) - LOCAL_LIBS = [ x for x in LIBS if x.startswith('$LIB_') ] - LIBS = [ x for x in LIBS if x not in LOCAL_LIBS ] if testSources: - testTargets.append(env.BoostUnitTests( + LOCAL_LIBS = [ x for x in LIBS if x.startswith('$LIB_') ] + LIBS = [ x for x in LIBS if x not in LOCAL_LIBS ] + test = env.BoostUnitTests( target = 'test_runner', source = sources, test_source = testSources + LOCAL_LIBS, LIBS = LIBS, - DEPENDS = LOCAL_LIBS)) + DEPENDS = LOCAL_LIBS) + env.Alias('all_tests', test) + env.Alias(env.File('test'), test) - env.Doxygen( - target = 'doc', - source = sources ) + #env.Doxygen( + # target = 'doc', + # source = sources ) return objects @@ -122,10 +121,16 @@ def StandardLib(env, library, sources, testSources = None, LIBS = []): lib = env.Library(library,objects) env.Default(lib) env.Append(**{ 'LIB_' + library : lib }) + env.Append(LIB_ALL = lib) return lib def StandardBinary(env, binary, sources, testSources = None, LIBS = []): objects = StandardObjects(env,sources,testSources,LIBS=LIBS) - program = env.Program(binary,objects) + LOCAL_LIBS = [ x for x in LIBS if x.startswith('$LIB_') ] + LIBS = [ x for x in LIBS if x not in LOCAL_LIBS ] + progEnv = env.Copy() + progEnv.Append(LIBS = LIBS) + program = progEnv.Program(target=binary,source=objects+LOCAL_LIBS) env.Default(program) + env.Depends(program, LOCAL_LIBS) return program