2005-09-24 12:07:57 +00:00
|
|
|
Import('env')
|
|
|
|
|
|
|
|
tests = Split('prepare.sh \
|
2015-08-29 09:28:04 +00:00
|
|
|
run-tests.pl \
|
|
|
|
cleanup.sh')
|
2005-09-24 12:07:57 +00:00
|
|
|
|
|
|
|
extra_dist = Split('fastcgi-10.conf \
|
2015-08-29 09:28:04 +00:00
|
|
|
fastcgi-responder.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 \
|
2018-12-11 03:35:21 +00:00
|
|
|
mod-auth.conf \
|
2015-08-29 09:28:04 +00:00
|
|
|
mod-auth.t \
|
|
|
|
mod-cgi.t \
|
|
|
|
mod-compress.t \
|
|
|
|
mod-compress.conf \
|
|
|
|
mod-fastcgi.t \
|
|
|
|
mod-userdir.t \
|
|
|
|
request.t \
|
|
|
|
mod-ssi.t \
|
|
|
|
LightyTest.pm \
|
|
|
|
mod-setenv.t')
|
|
|
|
|
|
|
|
fcgi_auth = None
|
|
|
|
fcgi_responder = None
|
2017-01-04 16:38:46 +00:00
|
|
|
scgi_responder = env.Program("scgi-responder", "scgi-responder.c")
|
2005-09-24 12:07:57 +00:00
|
|
|
|
2005-10-01 12:35:55 +00:00
|
|
|
if env['LIBFCGI']:
|
2015-08-29 09:28:04 +00:00
|
|
|
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
|
2005-10-01 12:35:55 +00:00
|
|
|
|
2015-08-29 09:28:04 +00:00
|
|
|
env.Alias('check', checks)
|