2007-08-13 09:55:32 +02:00
|
|
|
# -*- python -*-
|
|
|
|
|
##
|
|
|
|
|
## SConscript - SCons buildscript for the Testsuite (called by SConstruct)
|
|
|
|
|
##
|
|
|
|
|
|
2007-08-17 11:06:49 +02:00
|
|
|
import os
|
|
|
|
|
from Buildhelper import *
|
2007-08-13 09:55:32 +02:00
|
|
|
|
2007-08-17 11:06:49 +02:00
|
|
|
Import('env','artifacts','cinobj')
|
2007-08-13 09:55:32 +02:00
|
|
|
|
2007-08-17 11:06:49 +02:00
|
|
|
|
|
|
|
|
# build objects for the testcases...
|
|
|
|
|
#
|
|
|
|
|
env = env.Clone()
|
|
|
|
|
env.Append(CPPPATH = ['components','examples'])
|
|
|
|
|
|
|
|
|
|
testobj = srcSubtree(env,'components/*', isShared=False)
|
|
|
|
|
|
|
|
|
|
example = env.StaticLibrary('examples/cin3example', ['#$SRCDIR/lib/error.o','#$SRCDIR/lib/plugin.o'])
|
|
|
|
|
plugin = env.StaticLibrary('example_plugin.la', ['examples/example_plugin.c'])
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# build test applications
|
|
|
|
|
#
|
|
|
|
|
envp = env.Clone() # special Environment including libs for the plugin-test
|
|
|
|
|
envp.Append(LIBS = [example,plugin])
|
|
|
|
|
|
|
|
|
|
artifacts['testsuite'] = ts = ( env.Program('mainsuite', cinobj + testobj + ['components/mainsuite.cpp'])
|
|
|
|
|
+ envp.Program('errortest', example + ['examples/errortest.c'] )
|
|
|
|
|
+ envp.Program('plugin-example', example + plugin + ['examples/plugin_main.c'])
|
|
|
|
|
)
|
2007-08-13 09:55:32 +02:00
|
|
|
# TODO: we could apply much more "magic" here
|
2007-08-17 11:06:49 +02:00
|
|
|
# - organize the source of testcases more systematically
|
2007-08-13 09:55:32 +02:00
|
|
|
# - build /every/ $TESTDIR/*.cpp into an application
|
|
|
|
|
# - link the testobj dynamically
|
|
|
|
|
# - install additionally scripts into tests-dir if desired
|
|
|
|
|
|
|
|
|
|
|
2007-08-17 11:06:49 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# actually run the Testsuite
|
|
|
|
|
#
|
|
|
|
|
# - the product of running the Testsuite is the ",testlog"
|
|
|
|
|
# - it depends on all artifacts defined as "ts" above
|
|
|
|
|
#
|
|
|
|
|
runTs = env.Command(',testlog', ts, "./test.sh", chdir=1)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
|
# define Phony targets
|
|
|
|
|
# - 'scons testcode' triggers building of the Testsuite
|
|
|
|
|
# - 'scons check' triggers building and running
|
|
|
|
|
#
|
|
|
|
|
env.Alias('testcode', ts )
|
|
|
|
|
env.Alias('check', runTs )
|
|
|
|
|
|