X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=site_scons%2FSparseTestHack.py;h=f1a6f83854fda659f4a77067b805a0a6f6b18b97;hb=eb2dc72ff79098515b03945c611955704b1babe3;hp=3ecacafa9e40d536a3d39af3ecc606268b610873;hpb=60cc2731a8383758e768b552bccf842289ffd784;p=senf.git diff --git a/site_scons/SparseTestHack.py b/site_scons/SparseTestHack.py index 3ecacaf..f1a6f83 100644 --- a/site_scons/SparseTestHack.py +++ b/site_scons/SparseTestHack.py @@ -84,7 +84,7 @@ def setup(env): # This needs to be called after all build targets have been set # up. This is important since the list of object targets needs to be # complete. -def build(env): +def build(env, accept_unknown_tests=False): env = env.Clone(LIBS = [ '$EXTRA_LIBS' ]) if env.has_key("only_tests"): only_tests = {} @@ -124,7 +124,27 @@ def build(env): env.RealBoostUnitTest(target, objects, **kw) - only_tests = [ k for k,v in only_tests.iteritems() if not v ] - if only_tests: - raise SCons.Errors.StopError("Unknown unit tests (only_tests): %s." - % ", ".join("`%s'" % x for x in only_tests)) + if not accept_unknown_tests: + only_tests = [ k for k,v in only_tests.iteritems() if not v ] + if only_tests: + raise SCons.Errors.StopError("Unknown unit tests (only_tests): %s." + % ", ".join("`%s'" % x for x in only_tests)) + +def findSCMChanges(): + + def scmchanges(dir): + if os.popen("cd %s; svnversion" % dir.abspath).read().strip() == "exported": + return [ dir.Entry(x) + for x in os.popen("cd %s; git ls-files --modified" + % dir.abspath).read().strip().split("\n") ] + else: + return [ dir.Entry(l[7:]) + for l in os.popen("cd %s; svn status" + % dir.abspath).read().rstrip().split("\n") + if l[0] == 'M' ] + + changes=scmchanges(env.Dir('#')) + for dir in env.Dir('senf/Ext').glob("*"): + if isinstance(dir,SCons.Node.FS.Dir): + changes.extend(scmchanges(dir)) + return [ x for x in changes if not isinstance(x,SCons.Node.FS.Dir) ]