/[escript]/trunk/escript/test/DataAlgorithmAdapter/SConscript
ViewVC logotype

Contents of /trunk/escript/test/DataAlgorithmAdapter/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 288 - (show annotations)
Fri Dec 2 01:55:04 2005 UTC (13 years, 6 months ago) by jgs
File size: 3120 byte(s)
now automatically build unit tests as required based on dependencies
between unit tests and libraries

1 # Scons configuration file for DataAlgorithmAdapter unit tests
2
3 import os
4 import sys
5
6 #
7 # ensure correct versions of python and scons
8
9 EnsurePythonVersion(2,3)
10 EnsureSConsVersion(0,96)
11
12 #
13 # set appropriate defaults for configuration variables
14
15 esysroot = Dir('#../../..')
16 usegcc = 0
17 options = None
18 sys_libs = []
19
20 #
21 # import configuration variables passed in from
22 # calling SConscript (if any)
23
24 Import('*')
25
26 #
27 # retreive command-line arguments if any
28
29 if ARGUMENTS.get('usegcc',0):
30 usegcc = 1
31
32 if ARGUMENTS.get('options',0):
33 options = ARGUMENTS.get('options',0)
34
35 #
36 # determine platform
37
38 env = Environment(ENV = os.environ)
39 platform = env['PLATFORM']
40
41 #
42 # determine hostname
43
44 hostname = os.environ['HOSTNAME']
45
46 #
47 # load configuration settings
48
49 options_dir = str(esysroot) + '/scons'
50 sys.path.append(options_dir)
51
52 if hostname=='ess':
53 from ess_options import *
54
55 if usegcc==1:
56 from gcc_options import *
57
58 if options!=None:
59 exec "from " + options + " import *"
60
61 cxx_flags=cxx_flags_debug
62
63 #
64 # print out build configuration for this module
65
66 print "###################################################################"
67 print "Build configuration for module: DataAlgorithmAdapter unit tests"
68 print " dodebug: 1"
69 print " usegcc: ", usegcc
70 print " cxx: ", cxx
71 print " platform: ", platform
72 print " hostname: ", hostname
73 print "###################################################################"
74
75 #
76 # do the actual build
77
78 dataalgorithmadapter_test_path = str(esysroot) + '/escript/test/DataAlgorithmAdapter'
79 escript_path = str(esysroot) + '/escript/inc'
80 esysUtils_path = str(esysroot) + '/esysUtils/inc'
81 CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
82
83 esys_lib_path = str(esysroot) + '/lib'
84 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
85 CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
86
87 escript_lib = str(esys_lib_path) + '/libescriptcpp.so'
88
89 install_dir = str(esysroot) + '/escript/test'
90
91 cpp_path = [dataalgorithmadapter_test_path,
92 escript_path,
93 esysUtils_path,
94 CppUnitTest_path,
95 python_path,
96 boost_path]
97
98 lib_path = [esys_lib_path,
99 esysUtils_lib_path,
100 CppUnitTest_lib_path,
101 python_lib_path,
102 boost_lib_path]
103
104 libs = ['escriptcpp',
105 'esysUtils',
106 'CppUnitTest',
107 str(python_lib),
108 str(boost_lib),
109 'dl',
110 'util']
111
112 libs.extend(sys_libs)
113
114 sources = ['DataAlgorithmAdapterTestCase.cpp',
115 'DataAlgorithmAdapterTest.cpp']
116
117 target = 'DataAlgorithmAdapterTest.exe'
118
119 dataalgorithmadapter_env = Environment(ENV = os.environ)
120
121 dataalgorithmadapter_env.Replace(CXX = cxx)
122 dataalgorithmadapter_env.Replace(CXXFLAGS = cxx_flags)
123 dataalgorithmadapter_env.Replace(CPPPATH = cpp_path)
124 dataalgorithmadapter_env.Replace(LIBPATH = lib_path)
125 dataalgorithmadapter_env.Replace(LIBS = libs)
126
127 dataalgorithmadapter_test_exe = dataalgorithmadapter_env.Program(target, sources)
128
129 Depends(dataalgorithmadapter_test_exe, escript_lib)
130
131 dataalgorithmadapter_env.Install(install_dir, dataalgorithmadapter_test_exe)

  ViewVC Help
Powered by ViewVC 1.1.26