From 850f49904e3fd640cd697c621ce87d264260a389 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 23 Oct 2008 04:53:50 +0200 Subject: [PATCH] SCons: options for controling testsuite execution --- SConstruct | 4 +++- tests/SConscript | 12 ++++++++++-- tests/test.sh | 3 ++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 07b791cb0..567f6fadc 100644 --- a/SConstruct +++ b/SConstruct @@ -102,7 +102,7 @@ def appendVal(env,var,targetVar,val=None): def handleNoBugSwitches(env): """ set the build level for NoBug. Release builds imply no DEBUG - wheras ALPHA and BETA require DEBUG + whereas ALPHA and BETA require DEBUG """ level = env['BUILDLEVEL'] if level in ['ALPHA', 'BETA']: @@ -128,6 +128,8 @@ def defineCmdlineOptions(): allowed_values=('ALPHA', 'BETA', 'RELEASE')) ,BoolOption('DEBUG', 'Build with debugging information and no optimizations', False) ,BoolOption('OPTIMIZE', 'Build with strong optimization (-O3)', False) + ,BoolOption('VALGRIND', 'Run Testsuite under valgrind control', False) + ,('TESTSUITES', 'Run only Testsuites matching the given pattern', '') # ,BoolOption('OPENGL', 'Include support for OpenGL preview rendering', False) # ,EnumOption('DIST_TARGET', 'Build target architecture', 'auto', # allowed_values=('auto', 'i386', 'i686', 'x86_64' ), ignorecase=2) diff --git a/tests/SConscript b/tests/SConscript index 9fa09ae9e..f115d152b 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -3,6 +3,7 @@ ## SConscript - SCons buildscript for the Testsuite (called by SConstruct) ## +import os from os import path from Buildhelper import srcSubtree from Buildhelper import scanSubtree @@ -92,9 +93,16 @@ artifacts['testsuite'] = ts = ( [ testExecutable(env, dir) for dir in moduledirs # # - the product of running the Testsuite is the ",testlog" # - it depends on all artifacts defined as "ts" above +# - if not set via options switch, the environment variable TESTSUITES +# is explicitly propagated to test.sh # testEnv = env.Clone() -testEnv.Append(ENV = {'VALGRINDFLAGS' : 'DISABLE'}) +if not env['VALGRIND']: + testEnv.Append(ENV = {'VALGRINDFLAGS' : 'DISABLE'}) +testsuites = env['TESTSUITES'] or os.environ.get('TESTSUITES') +if testsuites: + testEnv['ENV']['TESTSUITES'] = testsuites + testDir = env.Dir('#$BINDIR') runTest = env.File("test.sh").abspath @@ -110,5 +118,5 @@ runTs = testEnv.Command(',testlog', ts, runTest, chdir=testDir) env.Alias('testcode', ts ) env.Alias('check', runTs ) -# declare tempfiles of test.sh as cleanable +# allow tempfiles of test.sh to be cleaned env.Clean ('check', [',testlog.pre',',expect_stdout',',stdout',',stderr',',testtmp','.libs']) diff --git a/tests/test.sh b/tests/test.sh index e2d5159b7..31c92da5b 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -200,7 +200,8 @@ function RUNTESTS() echo "$t" done | sort | uniq | { while read i; do - echo $i >&2 + echo + echo "### $i" >&2 if test -f $i; then source $i fi