From 81bf740b4e5ca8f790d788e87def6a911be06940 Mon Sep 17 00:00:00 2001
From: sbund <sbund@wiback.org>
Date: Tue, 11 Jul 2006 09:27:59 +0000
Subject: [PATCH] Better test target handling

---
 satscons/BoostUnitTests.py   | 8 +++++---
 satscons/SConstruct.template | 1 -
 satscons/SatSCons.py         | 6 +-----
 3 files changed, 6 insertions(+), 9 deletions(-)

diff --git a/satscons/BoostUnitTests.py b/satscons/BoostUnitTests.py
index 74a97ff1..78d399ad 100644
--- a/satscons/BoostUnitTests.py
+++ b/satscons/BoostUnitTests.py
@@ -13,11 +13,13 @@ def BoostUnitTests(env, target, source, test_source=None, LIBS = [], DEPENDS = [
     testEnv = env.Copy(**kw)
     testEnv.Append(LIBS = '$BOOSTTESTLIB')
     testEnv.Append(LIBS = LIBS)
-    testRunner = testEnv.Program('test', env.Object(source) + test_source)
+    testRunner = testEnv.Program(target, env.Object(source) + test_source)
     if DEPENDS:
         env.Depends(testRunner, DEPENDS)
-    return env.Alias(target, env.Command(os.path.join(path,'.'+name+'.stamp'), testRunner,
-                                  [ './$SOURCE $BOOSSTTESTARGS', 'touch $TARGET' ]))
+    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)
 
 
 def dispatcher(*arg,**kw):
diff --git a/satscons/SConstruct.template b/satscons/SConstruct.template
index e63f4470..27c68e35 100644
--- a/satscons/SConstruct.template
+++ b/satscons/SConstruct.template
@@ -18,4 +18,3 @@ Export('env')
 SConscript(glob.glob("*/SConscript"))
 
 SatSCons.StandardTargets(env)
-SatSCons.AllTests(env)
diff --git a/satscons/SatSCons.py b/satscons/SatSCons.py
index 0a6d8d0c..92061a4d 100644
--- a/satscons/SatSCons.py
+++ b/satscons/SatSCons.py
@@ -105,7 +105,7 @@ def StandardObjects(env, sources, testSources = None, LIBS = []):
     LIBS = [ x for x in LIBS if x not in LOCAL_LIBS ]
     if testSources:
         testTargets.append(env.BoostUnitTests(
-            target = 'test',
+            target = 'test_runner',
             source = sources,
             test_source = testSources + LOCAL_LIBS,
             LIBS = LIBS,
@@ -122,7 +122,3 @@ def StandardLib(env, library, sources, testSources = None, LIBS = []):
     lib = env.Library(library,objects)
     env.Default(lib)
     env.Append(**{ 'LIB_' + library : lib })
-
-def AllTests(env):
-    tests = env.Alias('tests')
-    env.Depends(tests, testTargets)
-- 
GitLab