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

Contents of /trunk/escript/test/DataC/SConscript

Parent Directory Parent Directory | Revision Log Revision Log


Revision 355 - (show annotations)
Wed Dec 14 05:05:31 2005 UTC (13 years, 4 months ago) by jgs
File size: 2926 byte(s)
add explicit target for building of unit tests

1 # Scons configuration file for DataC 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 import socket
45 hostname = socket.gethostname()
46
47 #
48 # load configuration settings
49
50 options_dir = str(esysroot) + '/scons'
51 sys.path.append(options_dir)
52
53 from default_options import *
54
55 if hostname=='ess':
56 from ess_options import *
57
58 if usegcc==1:
59 from gcc_options import *
60
61 if options!=None:
62 exec "from " + options + " import *"
63
64 cc_flags=cc_flags_debug
65 cxx_flags=cxx_flags_debug
66
67 #
68 # print out build configuration for this module
69
70 print "Build configuration for module: DataC unit tests"
71 print " dodebug: 1"
72 print " usegcc: ", usegcc
73 print " cc: ", cc
74 print " cxx: ", cxx
75 print " platform: ", platform
76 print " hostname: ", hostname
77
78 #
79 # do the actual build
80
81 datac_test_path = str(esysroot) + '/escript/test/DataC'
82 escript_path = str(esysroot) + '/escript/inc'
83 esysUtils_path = str(esysroot) + '/esysUtils/inc'
84 CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
85
86 esys_lib_path = str(esysroot) + '/lib'
87 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
88 CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
89
90 escript_lib = str(esys_lib_path) + '/libescriptcpp.so'
91
92 install_dir = str(esysroot) + '/escript/test'
93
94 cpp_path = [datac_test_path,
95 escript_path,
96 esysUtils_path,
97 CppUnitTest_path,
98 python_path,
99 boost_path]
100
101 lib_path = [esys_lib_path,
102 esysUtils_lib_path,
103 CppUnitTest_lib_path,
104 python_lib_path,
105 boost_lib_path]
106
107 libs = ['escriptcpp',
108 'esysUtils',
109 'CppUnitTest',
110 str(python_lib),
111 str(boost_lib),
112 'dl',
113 'util']
114
115 libs.extend(sys_libs)
116
117 sources = ['DataCTestCase.cpp',
118 'DataCTest.cpp',
119 'compareCCall.c',
120 'CompareFuncs.c']
121
122 target = 'DataCTest.exe'
123
124 datac_env = Environment(ENV = os.environ)
125
126 datac_env.Replace(CXX = cxx)
127 datac_env.Replace(CC = cc)
128 datac_env.Replace(CXXFLAGS = cxx_flags)
129 datac_env.Replace(CCFLAGS = cc_flags)
130 datac_env.Replace(CPPPATH = cpp_path)
131 datac_env.Replace(LIBPATH = lib_path)
132 datac_env.Replace(LIBS = libs)
133
134 datac_test_exe = datac_env.Program(target, sources)
135
136 Depends(datac_test_exe, escript_lib)
137
138 Alias("build_tests", datac_env.Install(install_dir, datac_test_exe))

  ViewVC Help
Powered by ViewVC 1.1.26