Files
libucore/test/SConscript
T
Nils O. Selåsdal e7d7f4b862 Add -k argument to test_runner to specify running only one test suite
alter --xml of test_runner to just -x
2013-11-26 18:17:07 +01:00

33 lines
906 B
Python

import platform
Import('env', 'build_type', 'prefix', 'version_info', 'test_xml')
test_env = env.Clone()
test_env.Append(LIBPATH = ['#build/src']);
test_env.Append(LIBS = ['ucore_' + build_type, 'check'])
system = platform.system()
#NetBSD needs /usr/pkg/...
if 'netbsd' in system.lower():
test_env.Append(LIBPATH = ['/usr/pkg/lib'])
test_env.Append(LINKFLAGS = ['-Wl,-rpath,/usr/pkg/lib'])
test_env.Append(CPPPATH = ['/usr/pkg/include'])
tests = test_env.Glob('test_*.c')
test_executable = 'test_runner'
#run test_runner --xml to produce an xml result file
if test_xml:
test_executable += ' -x'
prog = test_env.Program('test_runner', tests)
cmd = test_env.Command(target='test_phony' ,
source = None,
action= test_env.Dir('.').abspath + '/' + test_executable)
test_env.Depends(cmd, prog)
test_env.AlwaysBuild(cmd)