OLD | NEW |
| (Empty) |
1 # Copyright 2012 the V8 project authors. All rights reserved. | |
2 # Redistribution and use in source and binary forms, with or without | |
3 # modification, are permitted provided that the following conditions are | |
4 # met: | |
5 # | |
6 # * Redistributions of source code must retain the above copyright | |
7 # notice, this list of conditions and the following disclaimer. | |
8 # * Redistributions in binary form must reproduce the above | |
9 # copyright notice, this list of conditions and the following | |
10 # disclaimer in the documentation and/or other materials provided | |
11 # with the distribution. | |
12 # * Neither the name of Google Inc. nor the names of its | |
13 # contributors may be used to endorse or promote products derived | |
14 # from this software without specific prior written permission. | |
15 # | |
16 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
17 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
18 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
19 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
20 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
21 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
22 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
23 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
24 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
25 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
26 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
27 | |
28 import sys | |
29 from os.path import join, dirname, abspath | |
30 root_dir = dirname(File('SConstruct').rfile().abspath) | |
31 sys.path.append(join(root_dir, 'tools')) | |
32 import js2c | |
33 Import('context object_files tools') | |
34 | |
35 | |
36 # Needed for test-log. Paths are relative to the cctest dir. | |
37 JS_FILES_FOR_TESTS = [ | |
38 '../../../tools/splaytree.js', | |
39 '../../../tools/codemap.js', | |
40 '../../../tools/csvparser.js', | |
41 '../../../tools/consarray.js', | |
42 '../../../tools/profile.js', | |
43 '../../../tools/profile_view.js', | |
44 '../../../tools/logreader.js', | |
45 'log-eq-of-logging-and-traversal.js', | |
46 ] | |
47 | |
48 | |
49 SOURCES = { | |
50 'all': [ | |
51 'gay-fixed.cc', | |
52 'gay-precision.cc', | |
53 'gay-shortest.cc', | |
54 'test-accessors.cc', | |
55 'test-alloc.cc', | |
56 'test-api.cc', | |
57 'test-ast.cc', | |
58 'test-bignum-dtoa.cc', | |
59 'test-bignum.cc', | |
60 'test-circular-queue.cc', | |
61 'test-compiler.cc', | |
62 'test-conversions.cc', | |
63 'test-cpu-profiler.cc', | |
64 'test-dataflow.cc', | |
65 'test-date.cc', | |
66 'test-debug.cc', | |
67 'test-declarative-accessors.cc', | |
68 'test-decls.cc', | |
69 'test-deoptimization.cc', | |
70 'test-dictionary.cc', | |
71 'test-diy-fp.cc', | |
72 'test-double.cc', | |
73 'test-dtoa.cc', | |
74 'test-fast-dtoa.cc', | |
75 'test-fixed-dtoa.cc', | |
76 'test-flags.cc', | |
77 'test-func-name-inference.cc', | |
78 'test-hashing.cc', | |
79 'test-hashmap.cc', | |
80 'test-heap-profiler.cc', | |
81 'test-heap.cc', | |
82 'test-list.cc', | |
83 'test-liveedit.cc', | |
84 'test-lock.cc', | |
85 'test-lockers.cc', | |
86 'test-log.cc', | |
87 'test-mark-compact.cc', | |
88 'test-parsing.cc', | |
89 'test-platform-tls.cc', | |
90 'test-profile-generator.cc', | |
91 'test-random.cc', | |
92 'test-regexp.cc', | |
93 'test-reloc-info.cc', | |
94 'test-serialize.cc', | |
95 'test-sockets.cc', | |
96 'test-spaces.cc', | |
97 'test-strings.cc', | |
98 'test-symbols.cc', | |
99 'test-strtod.cc', | |
100 'test-thread-termination.cc', | |
101 'test-threads.cc', | |
102 'test-unbound-queue.cc', | |
103 'test-utils.cc', | |
104 'test-version.cc', | |
105 'test-weakmaps.cc' | |
106 ], | |
107 'arch:arm': [ | |
108 'test-assembler-arm.cc', | |
109 'test-disasm-arm.cc' | |
110 ], | |
111 'arch:ia32': [ | |
112 'test-assembler-ia32.cc', | |
113 'test-disasm-ia32.cc', | |
114 'test-log-stack-tracer.cc' | |
115 ], | |
116 'arch:x64': ['test-assembler-x64.cc', | |
117 'test-macro-assembler-x64.cc', | |
118 'test-log-stack-tracer.cc', | |
119 'test-disasm-x64.cc'], | |
120 'arch:mips': ['test-assembler-mips.cc', | |
121 'test-disasm-mips.cc'], | |
122 'os:linux': ['test-platform-linux.cc'], | |
123 'os:macos': ['test-platform-macos.cc'], | |
124 'os:nullos': ['test-platform-nullos.cc'], | |
125 'os:win32': ['test-platform-win32.cc'] | |
126 } | |
127 | |
128 | |
129 def Build(): | |
130 cctest_files = context.GetRelevantSources(SOURCES) | |
131 env = Environment(tools=tools) | |
132 env.Replace(**context.flags['cctest']) | |
133 context.ApplyEnvOverrides(env) | |
134 env['BUILDERS']['JS2C'] = Builder(action=js2c.JS2C) | |
135 | |
136 # Combine the JavaScript library files into a single C++ file and | |
137 # compile it. | |
138 js_files = [s for s in JS_FILES_FOR_TESTS] | |
139 js_files_src = env.JS2C( | |
140 ['js-files-for-cctest.cc'], js_files, **{'TYPE': 'TEST', 'COMPRESSION': 'off
'}) | |
141 js_files_obj = context.ConfigureObject(env, js_files_src, CPPPATH=['.']) | |
142 | |
143 # There seems to be a glitch in the way scons decides where to put | |
144 # PDB files when compiling using MSVC so we specify it manually. | |
145 # This should not affect any other platforms. | |
146 object_files.append(js_files_obj) | |
147 return env.Program('cctest', ['cctest.cc', cctest_files, object_files], | |
148 PDB='cctest.exe.pdb') | |
149 | |
150 | |
151 program = Build() | |
152 Return('program') | |
OLD | NEW |