1Import('env') 2 3tests = Split('prepare.sh \ 4 run-tests.pl \ 5 cleanup.sh') 6 7extra_dist = Split(' \ 8 condition.conf \ 9 core-condition.t \ 10 fastcgi-responder.conf \ 11 LightyTest.pm \ 12 lighttpd.conf \ 13 lighttpd.htpasswd \ 14 lighttpd.user \ 15 mod-fastcgi.t \ 16 mod-scgi.t \ 17 proxy.conf \ 18 request.t \ 19 scgi-responder.conf \ 20 var-include-sub.conf \ 21 wrapper.sh \ 22 ') 23 24fcgi_responder = env.Program("fcgi-responder", "fcgi-responder.c") 25scgi_responder = env.Program("scgi-responder", "scgi-responder.c") 26 27def CopyTestBinary(env, binary): 28 return env.Command(target = env['ENV']['top_builddir'] + '/tests/' + binary, source = binary, action = Copy("$TARGET", "$SOURCE")) 29 30def BuildTestEnv(env, build_type): 31 builddir = build_type 32 dependencies = [build_type] 33 if build_type == 'dynamic': 34 builddir = '.' 35 dependencies += ['modules'] 36 37 testenv = env.Clone() 38 testenv['ENV']['srcdir']='tests' 39 testenv['ENV']['top_builddir']='sconsbuild/' + builddir 40 prepare = testenv.AlwaysBuild(testenv.Command(build_type + '/prepare', 'prepare.sh', 'tests/prepare.sh')) 41 runtests = testenv.AlwaysBuild(testenv.Command(build_type + '/run-tests', 'run-tests.pl', 'tests/run-tests.pl')) 42 cleanup = testenv.AlwaysBuild(testenv.Command(build_type + '/cleanup', 'cleanup.sh', 'tests/cleanup.sh')) 43 testenv.Depends(runtests, prepare) 44 testenv.Depends(cleanup, runtests) 45 SideEffect('dummy-file-prevent-running-tests-in-parallel', runtests) 46 47 testenv.Depends(runtests, dependencies) 48 49 fcgis = [CopyTestBinary(testenv, 'fcgi-responder'), CopyTestBinary(testenv, 'scgi-responder')] 50 testenv.Depends(runtests, fcgis) 51 52 return [prepare, runtests, cleanup] 53 54check_dynamic = env.Alias('check_dynamic', BuildTestEnv(env, 'dynamic')) 55env.Depends(check_dynamic, 'modules') 56check_static = env.Alias('check_static', BuildTestEnv(env, 'static')) 57check_fullstatic = env.Alias('check_fullstatic', BuildTestEnv(env, 'fullstatic')) 58 59checks = [] 60 61if env['build_dynamic']: 62 checks += check_dynamic 63 64if env['build_static']: 65 checks += check_static 66 67if env['build_fullstatic']: 68 checks += check_fullstatic 69 70env.Alias('check', checks) 71