SCons: improve dependency handling for the testsuite

This commit is contained in:
Fischlurch 2010-06-26 05:08:16 +02:00
parent 7fbf84dd5d
commit 002f024ed8

View file

@ -5,6 +5,8 @@
import os import os
from os import path from os import path
from glob import glob
from Buildhelper import srcSubtree from Buildhelper import srcSubtree
from Buildhelper import scanSubtree from Buildhelper import scanSubtree
from Buildhelper import globRootdirs from Buildhelper import globRootdirs
@ -58,8 +60,9 @@ moduledirs = globRootdirs('*')
artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['bugs'] ] # was: ['lib','components'] artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['bugs'] ] # was: ['lib','components']
+ [ testCollection(env, dir) for dir in moduledirs if not dir in specials] + [ testCollection(env, dir) for dir in moduledirs if not dir in specials]
+ createPlugins(envPlu, 'plugin') + createPlugins(envPlu, 'plugin')
) + env.File(glob('*.tests')) # depending on the test definition files for test.sh
)
@ -70,8 +73,9 @@ artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in ['bugs'] ]
# #
# - the product of running the Testsuite is the ",testlog" # - the product of running the Testsuite is the ",testlog"
# - it depends on all artifacts defined as "ts" above # - it depends on all artifacts defined as "ts" above
# - if not set via options switch, the environment variable TESTSUITES # - including the tests/*.tests (suite definition files)
# is explicitly propagated to test.sh # - if not set via options switch, the environment variables
# TESTSUITES and VALGRINDFLAGS are explicitly propagated to test.sh
# #
testEnv = env.Clone() testEnv = env.Clone()
@ -80,25 +84,25 @@ if not valgrind and not env['VALGRIND']:
valgrind = 'DISABLE' valgrind = 'DISABLE'
testEnv.Append(ENV = { 'VALGRINDFLAGS' : valgrind testEnv.Append(ENV = { 'VALGRINDFLAGS' : valgrind
, 'LUMIERA_CONFIG_PATH' : './' , 'LUMIERA_CONFIG_PATH' : './'
}) })
testsuites = env['TESTSUITES'] or os.environ.get('TESTSUITES') testsuites = env['TESTSUITES'] or os.environ.get('TESTSUITES')
if testsuites: if testsuites:
testEnv['ENV']['TESTSUITES'] = testsuites testEnv['ENV']['TESTSUITES'] = testsuites
pluginpath = os.environ.get('LUMIERA_PLUGIN_PATH') pluginpath = os.environ.get('LUMIERA_PLUGIN_PATH')
if testsuites: if testsuites:
testEnv['ENV']['LUMIERA_PLUGIN_PATH'] = pluginpath testEnv['ENV']['LUMIERA_PLUGIN_PATH'] = pluginpath
# specify path to test.conf # specify path to test.conf
testEnv['ENV']['TEST_CONF'] = env.File("test.conf").abspath testEnv['ENV']['TEST_CONF'] = env.File("test.conf").abspath
testDir = env.Dir('#$BINDIR') testDir = env.Dir('#$BINDIR')
runTest = env.File("test.sh").abspath runTest = env.File("test.sh").abspath
runTs = testEnv.Command(',testlog', ts, runTest, chdir=testDir) runTs = testEnv.Command('#$BINDIR/,testlog', ts, runTest, chdir=testDir)
@ -111,4 +115,4 @@ env.Alias('testcode', ts )
env.Alias('check', runTs ) env.Alias('check', runTs )
# allow tempfiles of test.sh to be cleaned # allow tempfiles of test.sh to be cleaned
env.Clean ('check', [',testlog.pre',',expect_stdout',',stdout',',stderr',',testtmp','.libs']) env.Clean ('check', [',testlog',',testlog.pre',',expect_stdout',',stdout',',stderr',',testtmp','.libs'])