[core] set REDIRECT_STATUS to error_handler_saved_status (fixes #1828)
[lighttpd.git] / tests / SConscript
bloba4a5eb5687d8379ab4802b3a6dea83d62d07e80b
1 Import('env')
3 tests = Split('prepare.sh \
4         run-tests.pl \
5         cleanup.sh')
7 extra_dist = Split('fastcgi-10.conf \
8         fastcgi-auth.conf \
9         fastcgi-responder.conf \
10         fastcgi-13.conf \
11         bug-06.conf \
12         bug-12.conf \
13         core-var-include.t \
14         var-include.conf \
15         var-include-sub.conf \
16         condition.conf \
17         core-condition.t \
18         core-request.t \
19         core-response.t \
20         core-keepalive.t \
21         core.t \
22         mod-access.t \
23         mod-auth.t \
24         mod-cgi.t \
25         mod-compress.t \
26         mod-compress.conf \
27         mod-fastcgi.t \
28         mod-redirect.t \
29         mod-userdir.t \
30         mod-rewrite.t \
31         request.t \
32         mod-ssi.t \
33         LightyTest.pm \
34         mod-setenv.t')
36 fcgi_auth = None
37 fcgi_responder = None
39 if env['LIBFCGI']:
40         fcgi_auth = env.Program("fcgi-auth", "fcgi-auth.c", LIBS=[env['LIBFCGI'], env['APPEND_LIBS']])
41         fcgi_responder = env.Program("fcgi-responder", "fcgi-responder.c", LIBS=[env['LIBFCGI'], env['APPEND_LIBS']])
43 def CopyTestBinary(env, binary):
44         return env.Command(target = env['ENV']['top_builddir'] + '/tests/' + binary, source = binary, action = Copy("$TARGET", "$SOURCE"))
46 def BuildTestEnv(env, build_type):
47         builddir = build_type
48         dependencies = [build_type]
49         if build_type == 'dynamic':
50                 builddir = '.'
51                 dependencies += ['modules']
53         testenv = env.Clone()
54         testenv['ENV']['srcdir']='tests'
55         testenv['ENV']['top_builddir']='sconsbuild/' + builddir
56         prepare = testenv.AlwaysBuild(testenv.Command(build_type + '/prepare', 'prepare.sh', 'tests/prepare.sh'))
57         runtests = testenv.AlwaysBuild(testenv.Command(build_type + '/run-tests', 'run-tests.pl', 'tests/run-tests.pl'))
58         cleanup = testenv.AlwaysBuild(testenv.Command(build_type + '/cleanup', 'cleanup.sh', 'tests/cleanup.sh'))
59         testenv.Depends(runtests, prepare)
60         testenv.Depends(cleanup, runtests)
61         SideEffect('dummy-file-prevent-running-tests-in-parallel', runtests)
63         testenv.Depends(runtests, dependencies)
65         if env['LIBFCGI']:
66                 fcgis = [CopyTestBinary(testenv, 'fcgi-auth'), CopyTestBinary(testenv, 'fcgi-responder')]
67                 testenv.Depends(runtests, fcgis)
69         return [prepare, runtests, cleanup]
71 check_dynamic = env.Alias('check_dynamic', BuildTestEnv(env, 'dynamic'))
72 env.Depends(check_dynamic, 'modules')
73 check_static = env.Alias('check_static', BuildTestEnv(env, 'static'))
74 check_fullstatic = env.Alias('check_fullstatic', BuildTestEnv(env, 'fullstatic'))
76 checks = []
78 if env['build_dynamic']:
79         checks += check_dynamic
81 if env['build_static']:
82         checks += check_static
84 if env['build_fullstatic']:
85         checks += check_fullstatic
87 env.Alias('check', checks)