X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=senfscons%2FBoostUnitTests.py;h=3733455dec7c6da25375c66ee11031c39ff56627;hb=63b650afb727cce067817ce9451eecb932446bf3;hp=e6aed7af765857d2063e03625fca1bc36972217f;hpb=2d51a34f79dd18b23c54172444b2cc7433b8f5f0;p=senf.git diff --git a/senfscons/BoostUnitTests.py b/senfscons/BoostUnitTests.py index e6aed7a..3733455 100644 --- a/senfscons/BoostUnitTests.py +++ b/senfscons/BoostUnitTests.py @@ -26,22 +26,22 @@ import SCons.Defaults import os.path import os -def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [], **kw): +def BoostUnitTests(env, target, objects, test_sources=None, LIBS = [], OBJECTS = [], DEPENDS = [], **kw): path, name = os.path.split(target) - if test_source: - if type(test_source) is not type([]): - test_source = [ test_source ] + if test_sources: + if type(test_sources) is not type([]): + test_sources = [ test_sources ] else: - test_source = [] + test_sources = [] testEnv = env.Copy(**kw) - testEnv.Prepend(LIBS = '$BOOSTTESTLIB') + testEnv.Prepend(_LIBFLAGS = ' -Wl,-Bstatic -l$BOOSTTESTLIB -Wl,-Bdynamic ') testEnv.Prepend(LIBS = LIBS) - sources = [] - if source: - sources = sources + env.Object(source) - sources = sources + test_source + all_objects = [] + if not objects: + objects = [] + all_objects = objects + env.Object(test_sources) + OBJECTS binName = os.path.join(path,'.' + name +'.bin') - testRunner = testEnv.Program(binName, sources) + testRunner = testEnv.Program(binName, all_objects) stamp = os.path.join(path,'.' + os.path.splitext(name)[0]+'.stamp') if DEPENDS: env.Depends(testRunner, DEPENDS)