Files
libucore/test/SConscript
T

33 lines
928 B
Python

import platform
Import('env', 'build_type', 'prefix', 'lib_suffix', 'version_info', 'test_xml')
test_env = env.Clone()
test_env.Append(LIBPATH = ['#build/src']);
test_env.Append(LIBS = ['ucore' + lib_suffix, 'check','m','rt'])
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)