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

Contents of /trunk/escript/test/DataArrayView/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: 2900 byte(s)
add explicit target for building of unit tests

1 # Scons configuration file for DataArrayView 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 cxx_flags=cxx_flags_debug
65
66 #
67 # print out build configuration for this module
68
69 print "Build configuration for module: DataArrayView unit tests"
70 print " dodebug: 1"
71 print " usegcc: ", usegcc
72 print " cxx: ", cxx
73 print " platform: ", platform
74 print " hostname: ", hostname
75
76 #
77 # do the actual build
78
79 dataarrayview_test_path = str(esysroot) + '/escript/test/DataArrayView'
80 escript_path = str(esysroot) + '/escript/inc'
81 esysUtils_path = str(esysroot) + '/esysUtils/inc'
82 CppUnitTest_path = str(esysroot) + '/tools/CppUnitTest/inc'
83
84 esys_lib_path = str(esysroot) + '/lib'
85 esysUtils_lib_path = str(esysroot) + '/esysUtils/lib'
86 CppUnitTest_lib_path = str(esysroot) + '/tools/CppUnitTest/lib'
87
88 escript_lib = str(esys_lib_path) + '/libescriptcpp.so'
89
90 install_dir = str(esysroot) + '/escript/test'
91
92 cpp_path = [dataarrayview_test_path,
93 escript_path,
94 esysUtils_path,
95 CppUnitTest_path,
96 python_path,
97 boost_path]
98
99 lib_path = [esys_lib_path,
100 esysUtils_lib_path,
101 CppUnitTest_lib_path,
102 python_lib_path,
103 boost_lib_path]
104
105 libs = ['escriptcpp',
106 'esysUtils',
107 'CppUnitTest',
108 str(python_lib),
109 str(boost_lib),
110 'dl',
111 'util']
112
113 libs.extend(sys_libs)
114
115 sources = ['DataArrayViewTestCase.cpp',
116 'DataArrayViewTest.cpp']
117
118 target = 'DataArrayViewTest.exe'
119
120 dataarrayview_env = Environment(ENV = os.environ)
121
122 dataarrayview_env.Replace(CXX = cxx)
123 dataarrayview_env.Replace(CXXFLAGS = cxx_flags)
124 dataarrayview_env.Replace(CPPPATH = cpp_path)
125 dataarrayview_env.Replace(LIBPATH = lib_path)
126 dataarrayview_env.Replace(LIBS = libs)
127
128 dataarrayview_test_exe = dataarrayview_env.Program(target, sources)
129
130 Depends(dataarrayview_test_exe, escript_lib)
131
132 Alias("build_tests", dataarrayview_env.Install(install_dir, dataarrayview_test_exe))

  ViewVC Help
Powered by ViewVC 1.1.26