diff options
author | Stefan Bühler <stbuehler@web.de> | 2015-08-29 09:28:04 +0000 |
---|---|---|
committer | Stefan Bühler <stbuehler@web.de> | 2015-08-29 09:28:04 +0000 |
commit | 68284bd7f11defea1a43cf987f501415ed29f4a5 (patch) | |
tree | 2cdd4c54cb1cdb758acd6af963c1ed4c246f5b7a /tests/SConscript | |
parent | b66fa2cb68a7c0ca6fae280bd71662d5ddce8c24 (diff) | |
download | lighttpd-git-68284bd7f11defea1a43cf987f501415ed29f4a5.tar.gz |
[scons] various improvements
- don't generate files in src/
- move all build stuff to sconsbuild/
- have different output directories for static/ and fullstatic/,
so we can use that directory for the test suite
- each build type (dynamic, static, fullstatic) has its own check target
- read CFLAGS, LDFLAGS and LIBS from environment
(LIBS are appended after all other dependencies)
From: Stefan Bühler <stbuehler@web.de>
git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@3030 152afb58-edef-0310-8abb-c4023f1b3aa9
Diffstat (limited to 'tests/SConscript')
-rw-r--r-- | tests/SConscript | 117 |
1 files changed, 79 insertions, 38 deletions
diff --git a/tests/SConscript b/tests/SConscript index 4ce7e1ec..a4a5eb56 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -1,46 +1,87 @@ Import('env') tests = Split('prepare.sh \ - run-tests.pl \ - cleanup.sh') + run-tests.pl \ + cleanup.sh') extra_dist = Split('fastcgi-10.conf \ - fastcgi-auth.conf \ - fastcgi-responder.conf \ - fastcgi-13.conf \ - bug-06.conf \ - bug-12.conf \ - core-var-include.t \ - var-include.conf \ - var-include-sub.conf \ - condition.conf \ - core-condition.t \ - core-request.t \ - core-response.t \ - core-keepalive.t \ - core.t \ - mod-access.t \ - mod-auth.t \ - mod-cgi.t \ - mod-compress.t \ - mod-compress.conf \ - mod-fastcgi.t \ - mod-redirect.t \ - mod-userdir.t \ - mod-rewrite.t \ - request.t \ - mod-ssi.t \ - LightyTest.pm \ - mod-setenv.t') - -t = env.Command('foo1', 'prepare.sh', '(cd ./tests/; ./prepare.sh; cd ..)') -t += env.Command('foo2', 'run-tests.pl', '( cd ./tests/; SHELL=/bin/sh ./run-tests.pl; cd ..)') -t += env.Command('foo3', 'cleanup.sh', '(cd ./tests/; ./cleanup.sh; cd ..)') + fastcgi-auth.conf \ + fastcgi-responder.conf \ + fastcgi-13.conf \ + bug-06.conf \ + bug-12.conf \ + core-var-include.t \ + var-include.conf \ + var-include-sub.conf \ + condition.conf \ + core-condition.t \ + core-request.t \ + core-response.t \ + core-keepalive.t \ + core.t \ + mod-access.t \ + mod-auth.t \ + mod-cgi.t \ + mod-compress.t \ + mod-compress.conf \ + mod-fastcgi.t \ + mod-redirect.t \ + mod-userdir.t \ + mod-rewrite.t \ + request.t \ + mod-ssi.t \ + LightyTest.pm \ + mod-setenv.t') + +fcgi_auth = None +fcgi_responder = None if env['LIBFCGI']: - fcgis = [] - fcgis += env.Program("fcgi-auth", "fcgi-auth.c", LIBS=env['LIBFCGI']) - fcgis += env.Program("fcgi-responder", "fcgi-responder.c", LIBS=env['LIBFCGI']) - env.Depends(t, fcgis) + fcgi_auth = env.Program("fcgi-auth", "fcgi-auth.c", LIBS=[env['LIBFCGI'], env['APPEND_LIBS']]) + fcgi_responder = env.Program("fcgi-responder", "fcgi-responder.c", LIBS=[env['LIBFCGI'], env['APPEND_LIBS']]) + +def CopyTestBinary(env, binary): + return env.Command(target = env['ENV']['top_builddir'] + '/tests/' + binary, source = binary, action = Copy("$TARGET", "$SOURCE")) + +def BuildTestEnv(env, build_type): + builddir = build_type + dependencies = [build_type] + if build_type == 'dynamic': + builddir = '.' + dependencies += ['modules'] + + testenv = env.Clone() + testenv['ENV']['srcdir']='tests' + testenv['ENV']['top_builddir']='sconsbuild/' + builddir + prepare = testenv.AlwaysBuild(testenv.Command(build_type + '/prepare', 'prepare.sh', 'tests/prepare.sh')) + runtests = testenv.AlwaysBuild(testenv.Command(build_type + '/run-tests', 'run-tests.pl', 'tests/run-tests.pl')) + cleanup = testenv.AlwaysBuild(testenv.Command(build_type + '/cleanup', 'cleanup.sh', 'tests/cleanup.sh')) + testenv.Depends(runtests, prepare) + testenv.Depends(cleanup, runtests) + SideEffect('dummy-file-prevent-running-tests-in-parallel', runtests) + + testenv.Depends(runtests, dependencies) + + if env['LIBFCGI']: + fcgis = [CopyTestBinary(testenv, 'fcgi-auth'), CopyTestBinary(testenv, 'fcgi-responder')] + testenv.Depends(runtests, fcgis) + + return [prepare, runtests, cleanup] + +check_dynamic = env.Alias('check_dynamic', BuildTestEnv(env, 'dynamic')) +env.Depends(check_dynamic, 'modules') +check_static = env.Alias('check_static', BuildTestEnv(env, 'static')) +check_fullstatic = env.Alias('check_fullstatic', BuildTestEnv(env, 'fullstatic')) + +checks = [] + +if env['build_dynamic']: + checks += check_dynamic + +if env['build_static']: + checks += check_static + +if env['build_fullstatic']: + checks += check_fullstatic -env.Alias('check', t ) +env.Alias('check', checks) |