From: g0dil Date: Fri, 9 Oct 2009 14:47:36 +0000 (+0000) Subject: Add some docs and diagnostics to test_changes build target X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=b15970febb699b9854094b49ad309b748d60776b;p=senf.git Add some docs and diagnostics to test_changes build target git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1493 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/SConstruct b/SConstruct index 0cd8837..d853a52 100644 --- a/SConstruct +++ b/SConstruct @@ -21,6 +21,7 @@ prepare Create all target files not part of the repository default Build all default targets (like calling scons with no arguments) examples Build all examples all_tests Build and run unit tests for all modules +test_changes Build tests only for files with local changes (queries svn or git) all_docs Build documentation for all modules all Build everything install_all Install SENF into $$PREFIX @@ -152,7 +153,8 @@ SConscript("Examples/SConscript") SConscript("HowTos/SConscript") SConscript("doclib/SConscript") if env['sparse_tests']: - SparseTestHack.build(env, 'test_changes' in COMMAND_LINE_TARGETS) + verbose = 'test_changes' in COMMAND_LINE_TARGETS + SparseTestHack.build(env, verbose, verbose) ########################################################################### # Define build targets diff --git a/site_scons/SparseTestHack.py b/site_scons/SparseTestHack.py index 52b05e6..c8681d0 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, accept_unknown_tests=False): +def build(env, accept_unknown_tests=False, verbose=False): env = env.Clone(LIBS = [ '$EXTRA_LIBS' ]) if env.has_key("only_tests"): only_tests = {} @@ -124,6 +124,10 @@ def build(env, accept_unknown_tests=False): env.RealBoostUnitTest(target, objects, **kw) + if verbose and only_tests and not env.GetOption('no_progress'): + SCons.Util.display("scons: building tests: " + ", ".join("`%s'" % str(k) + for k,v in only_tests.iteritems() + if v)) if not accept_unknown_tests: only_tests = [ k for k,v in only_tests.iteritems() if not v ] if only_tests: