From 526e62aa972171689c2338b3539e40db33f608cb Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 20 Sep 2007 03:46:14 +0200 Subject: [PATCH] SCons: (re)enable locking and lib-tests --- tests/SConscript | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/tests/SConscript b/tests/SConscript index 1aec1b7b7..bc1095f1d 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -3,13 +3,14 @@ ## SConscript - SCons buildscript for the Testsuite (called by SConstruct) ## +from os import path from Buildhelper import srcSubtree from Buildhelper import globRootdirs Import('env','artifacts','corelib') -def SingleTestExecutableSubdir(env,tree): +def testExecutable(env,tree, exeName=None, obj=None): """ declare all targets needed to create a standalone Test executalbe of the given Sub-tree. Note that each subdir is built in its own Environment. @@ -17,9 +18,13 @@ def SingleTestExecutableSubdir(env,tree): env = env.Clone() env.Append(CPPPATH=tree) # add Subdir to Includepath tree = env.subst(tree) # expand Construction Vars - exeName = 'test-%s' % tree - objects = srcSubtree(env,tree) - return env.Program('#$BINDIR/'+exeName, objects + corelib) + if obj: + obj = [path.join(tree,name) for name in obj] + else: + obj = srcSubtree(env,tree) # use all sourcefiles found in subtree + if not exeName: + exeName = 'test-%s' % tree + return env.Program('#$BINDIR/'+exeName, obj + corelib) def treatPluginTestcase(env): @@ -46,13 +51,16 @@ def treatPluginTestcase(env): # build a Test-Executable out of every subdir... moduledirs = globRootdirs('*') -# -# have to treat the plugin-example specially. -isnt_plugin = lambda dir : not (dir=='plugin' or dir=='locking') -moduledirs = filter(isnt_plugin, moduledirs) -pluginExe = treatPluginTestcase(env) +# but have to treat some subdirs individually. +specials = ['plugin','locking','library'] -artifacts['testsuite'] = ts = [ SingleTestExecutableSubdir(env, dir) for dir in moduledirs] + pluginExe + + +artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in moduledirs if not dir in specials] + + treatPluginTestcase(env) + + testExecutable(env, 'library', exeName='test-llist', obj=['test-llist.c']) + + testExecutable(env, 'library', exeName='test-references', obj=['test-references.c']) + )