From: g0dil Date: Mon, 31 Aug 2009 13:45:24 +0000 (+0000) Subject: Add tools to senfutil.py X-Git-Url: http://g0dil.de/git?p=senf.git;a=commitdiff_plain;h=294d299c3366cc436d14f16d72caab8d697da7c2 Add tools to senfutil.py git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1356 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/debian/SConscript b/debian/SConscript index aea26db..85904db 100644 --- a/debian/SConscript +++ b/debian/SConscript @@ -97,7 +97,7 @@ env.PhonyTarget('deb', [], [ checkLocalConf, updateRevision, "$BUILDPACKAGE_COMMAND", - "fakeroot ./debian/rules debclean" + "fakeroot ./debian/rules clean" ]) env.PhonyTarget('debsrc', [], [ @@ -109,7 +109,7 @@ env.PhonyTarget('debbin', [], [ checkLocalConf, updateRevision, "$BUILDPACKAGE_COMMAND -b", - "fakeroot ./debian/rules debclean" + "fakeroot ./debian/rules clean" ]) if not os.environ.get('debian_build'): diff --git a/site_scons/senfutil.py b/site_scons/senfutil.py index 1cb88e3..73f6b26 100644 --- a/site_scons/senfutil.py +++ b/site_scons/senfutil.py @@ -60,8 +60,13 @@ Special command line parameters: # c) check for a local SENF, set options accordingly and update that SENF if needed def SetupForSENF(env, senf_paths = []): - senf_paths.extend(('senf', '../senf', os.path.dirname(os.path.dirname(__file__)), - '/usr/local', '/usr')) + senfutildir = os.path.dirname(__file__) + senf_paths.extend(('senf', '../senf', os.path.dirname(senfutildir), '/usr/local', '/usr')) + tooldir = os.path.join(senfutildir, 'site_tools') + + env.Tool('Boost', [ tooldir ]) + env.Tool('PhonyTarget', [ tooldir ]) + env.Append( LIBS = [ 'senf', 'rt', '$BOOSTREGEXLIB', '$BOOSTIOSTREAMSLIB', '$BOOSTSIGNALSLIB', @@ -145,3 +150,12 @@ def DefaultOptions(env): LINKFLAGS_normal = [ '-Wl,-S' ], LINKFLAGS_debug = [ '-g' ], ) + +def Glob(env, exclude=[], subdirs=[]): + testSources = glob.glob("*.test.cc") + sources = [ x for x in glob.glob("*.cc") if x not in testSources and x not in exclude ] + for subdir in subdirs: + testSources += glob.glob(os.path.join(subdir,"*.test.cc")) + sources += [ x for x in glob.glob(os.path.join(subdir,"*.cc")) + if x not in testSources and x not in exclude ] + return (sources, testSources) diff --git a/site_scons/site_tools/Boost.py b/site_scons/site_tools/Boost.py index 7c0255b..c0dbce4 100644 --- a/site_scons/site_tools/Boost.py +++ b/site_scons/site_tools/Boost.py @@ -77,6 +77,8 @@ def CompileCheck(target, source, env): CompileCheck = SCons.Script.Action(CompileCheck) def BoostUnitTest(env, target=None, source=None, **kw): + global _ALL_TESTS + target = env.arg2nodes(target)[0] source = env.arg2nodes(source) @@ -89,7 +91,7 @@ def BoostUnitTest(env, target=None, source=None, **kw): **kw) stamp = env.Command(stampnode, bin, - [ '$SOURCE $BOOSTTESTARGS', SCons.Script.Touch('$TARGET')], + [ './$SOURCE $BOOSTTESTARGS', SCons.Script.Touch('$TARGET')], **kw) alias = env.Command(env.File(target), stamp, [ env.NopAction() ] ) @@ -106,6 +108,7 @@ def BoostUnitTest(env, target=None, source=None, **kw): return alias def FindAllBoostUnitTests(env, target, source): + global _ALL_TESTS return _ALL_TESTS def NopAction(env, target, source):