| 1 |
#!/usr/bin/python invoke_using_scons |
| 2 |
Import('test_env') |
| 3 |
import platform |
| 4 |
|
| 5 |
# local sources |
| 6 |
srcs = ['test.c','test_ascend_base.c','redirectStdStreams.c','printutil.c','assertimpl.c'] |
| 7 |
|
| 8 |
# test cases from the different tested modules |
| 9 |
for dir in test_env['TESTDIRS']: |
| 10 |
srcs += test_env['TESTSRCS_'+dir.upper()] |
| 11 |
|
| 12 |
test_env.Append( |
| 13 |
LIBS = ['ascend','cunit'] |
| 14 |
, LIBPATH = ['#'] |
| 15 |
, CPPDEFINES = ['-DASC_SHARED'] |
| 16 |
) |
| 17 |
|
| 18 |
if test_env.get('WITH_PCRE'): |
| 19 |
test_env.AppendUnique( |
| 20 |
CPPPATH=test_env.get('PCRE_CPPPATH') |
| 21 |
,LIBS=test_env['PCRE_LIBS'] |
| 22 |
,LIBPATH=test_env.get('PCRE_LIBPATH') |
| 23 |
) |
| 24 |
|
| 25 |
if test_env.has_key('CUNIT_CPPPATH'): |
| 26 |
test_env.Append(CPPPATH=test_env['CUNIT_CPPPATH']) |
| 27 |
|
| 28 |
if test_env.has_key('CUNIT_LIBPATH'): |
| 29 |
test_env.Append(LIBPATH=test_env['CUNIT_LIBPATH']) |
| 30 |
|
| 31 |
testprog = test_env.Program('test',srcs |
| 32 |
, LINKFLAGS=['-Wl,-rpath,\'$$ORIGIN/..\''] |
| 33 |
) |
| 34 |
|
| 35 |
test_env.Depends(testprog,['#/ascend','#/solvers','#/models']) |
| 36 |
|
| 37 |
test_env.Depends(testprog,"#/ascend/utilities/test") |
| 38 |
|
| 39 |
if platform.system()=="Windows": |
| 40 |
test_env.Depends(testprog,test_env['libascend']) |
| 41 |
else: |
| 42 |
test_env.Depends(testprog,"#/libascend.so.1") |
| 43 |
|
| 44 |
|