1b851e44cfc1bbb8575accaddbe38d94ad8fab6f
[platform/upstream/nodejs.git] / deps / v8 / test / cctest / cctest.gyp
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 {
29   'variables': {
30     'v8_code': 1,
31     'generated_file': '<(SHARED_INTERMEDIATE_DIR)/resources.cc',
32   },
33   'includes': ['../../build/toolchain.gypi', '../../build/features.gypi'],
34   'targets': [
35     {
36       'target_name': 'cctest',
37       'type': 'executable',
38       'dependencies': [
39         'resources',
40         '../../tools/gyp/v8.gyp:v8_libplatform',
41       ],
42       'include_dirs': [
43         '../..',
44       ],
45       'sources': [  ### gcmole(all) ###
46         '<(generated_file)',
47         'compiler/c-signature.h',
48         'compiler/codegen-tester.cc',
49         'compiler/codegen-tester.h',
50         'compiler/function-tester.h',
51         'compiler/graph-builder-tester.cc',
52         'compiler/graph-builder-tester.h',
53         'compiler/graph-tester.h',
54         'compiler/simplified-graph-builder.cc',
55         'compiler/simplified-graph-builder.h',
56         'compiler/test-basic-block-profiler.cc',
57         'compiler/test-branch-combine.cc',
58         'compiler/test-changes-lowering.cc',
59         'compiler/test-codegen-deopt.cc',
60         'compiler/test-control-reducer.cc',
61         'compiler/test-gap-resolver.cc',
62         'compiler/test-graph-visualizer.cc',
63         'compiler/test-instruction.cc',
64         'compiler/test-js-context-specialization.cc',
65         'compiler/test-js-constant-cache.cc',
66         'compiler/test-js-typed-lowering.cc',
67         'compiler/test-jump-threading.cc',
68         'compiler/test-linkage.cc',
69         'compiler/test-loop-assignment-analysis.cc',
70         'compiler/test-loop-analysis.cc',
71         'compiler/test-machine-operator-reducer.cc',
72         'compiler/test-node-algorithm.cc',
73         'compiler/test-node-cache.cc',
74         'compiler/test-node.cc',
75         'compiler/test-operator.cc',
76         'compiler/test-osr.cc',
77         'compiler/test-pipeline.cc',
78         'compiler/test-representation-change.cc',
79         'compiler/test-run-deopt.cc',
80         'compiler/test-run-inlining.cc',
81         'compiler/test-run-intrinsics.cc',
82         'compiler/test-run-jsbranches.cc',
83         'compiler/test-run-jscalls.cc',
84         'compiler/test-run-jsexceptions.cc',
85         'compiler/test-run-jsops.cc',
86         'compiler/test-run-machops.cc',
87         'compiler/test-run-properties.cc',
88         'compiler/test-run-stackcheck.cc',
89         'compiler/test-run-variables.cc',
90         'compiler/test-simplified-lowering.cc',
91         'cctest.cc',
92         'gay-fixed.cc',
93         'gay-precision.cc',
94         'gay-shortest.cc',
95         'print-extension.cc',
96         'profiler-extension.cc',
97         'test-accessors.cc',
98         'test-alloc.cc',
99         'test-api.cc',
100         'test-api.h',
101         'test-api-interceptors.cc',
102         'test-ast.cc',
103         'test-atomicops.cc',
104         'test-bignum.cc',
105         'test-bignum-dtoa.cc',
106         'test-bit-vector.cc',
107         'test-circular-queue.cc',
108         'test-compiler.cc',
109         'test-constantpool.cc',
110         'test-conversions.cc',
111         'test-cpu-profiler.cc',
112         'test-date.cc',
113         'test-debug.cc',
114         'test-decls.cc',
115         'test-deoptimization.cc',
116         'test-dictionary.cc',
117         'test-diy-fp.cc',
118         'test-double.cc',
119         'test-dtoa.cc',
120         'test-fast-dtoa.cc',
121         'test-feedback-vector.cc',
122         'test-fixed-dtoa.cc',
123         'test-flags.cc',
124         'test-func-name-inference.cc',
125         'test-gc-tracer.cc',
126         'test-global-handles.cc',
127         'test-global-object.cc',
128         'test-hashing.cc',
129         'test-hashmap.cc',
130         'test-heap.cc',
131         'test-heap-profiler.cc',
132         'test-hydrogen-types.cc',
133         'test-list.cc',
134         'test-liveedit.cc',
135         'test-lockers.cc',
136         'test-log.cc',
137         'test-microtask-delivery.cc',
138         'test-mark-compact.cc',
139         'test-mementos.cc',
140         'test-migrations.cc',
141         'test-object-observe.cc',
142         'test-ordered-hash-table.cc',
143         'test-parsing.cc',
144         'test-platform.cc',
145         'test-profile-generator.cc',
146         'test-random-number-generator.cc',
147         'test-regexp.cc',
148         'test-reloc-info.cc',
149         'test-representation.cc',
150         'test-sampler-api.cc',
151         'test-serialize.cc',
152         'test-spaces.cc',
153         'test-strings.cc',
154         'test-symbols.cc',
155         'test-strtod.cc',
156         'test-thread-termination.cc',
157         'test-threads.cc',
158         'test-transitions.cc',
159         'test-types.cc',
160         'test-unbound-queue.cc',
161         'test-unboxed-doubles.cc',
162         'test-unique.cc',
163         'test-unscopables-hidden-prototype.cc',
164         'test-utils.cc',
165         'test-version.cc',
166         'test-weakmaps.cc',
167         'test-weaksets.cc',
168         'test-weaktypedarrays.cc',
169         'trace-extension.cc',
170         '../../src/startup-data-util.h',
171         '../../src/startup-data-util.cc'
172       ],
173       'conditions': [
174         ['v8_target_arch=="ia32"', {
175           'sources': [  ### gcmole(arch:ia32) ###
176             'test-assembler-ia32.cc',
177             'test-code-stubs.cc',
178             'test-code-stubs-ia32.cc',
179             'test-disasm-ia32.cc',
180             'test-macro-assembler-ia32.cc',
181             'test-log-stack-tracer.cc'
182           ],
183         }],
184         ['v8_target_arch=="x64"', {
185           'sources': [  ### gcmole(arch:x64) ###
186             'test-assembler-x64.cc',
187             'test-code-stubs.cc',
188             'test-code-stubs-x64.cc',
189             'test-disasm-x64.cc',
190             'test-macro-assembler-x64.cc',
191             'test-log-stack-tracer.cc'
192           ],
193         }],
194         ['v8_target_arch=="arm"', {
195           'sources': [  ### gcmole(arch:arm) ###
196             'test-assembler-arm.cc',
197             'test-code-stubs.cc',
198             'test-code-stubs-arm.cc',
199             'test-disasm-arm.cc',
200             'test-macro-assembler-arm.cc'
201           ],
202         }],
203         ['v8_target_arch=="arm64"', {
204           'sources': [  ### gcmole(arch:arm64) ###
205             'test-utils-arm64.cc',
206             'test-assembler-arm64.cc',
207             'test-code-stubs.cc',
208             'test-code-stubs-arm64.cc',
209             'test-disasm-arm64.cc',
210             'test-fuzz-arm64.cc',
211             'test-javascript-arm64.cc',
212             'test-js-arm64-variables.cc'
213           ],
214         }],
215         ['v8_target_arch=="ppc"', {
216           'sources': [  ### gcmole(arch:ppc) ###
217             'test-assembler-ppc.cc',
218             'test-code-stubs.cc',
219             'test-disasm-ppc.cc'
220           ],
221         }],
222         ['v8_target_arch=="ppc64"', {
223           'sources': [  ### gcmole(arch:ppc64) ###
224             'test-assembler-ppc.cc',
225             'test-code-stubs.cc',
226             'test-disasm-ppc.cc'
227           ],
228         }],
229         ['v8_target_arch=="mipsel"', {
230           'sources': [  ### gcmole(arch:mipsel) ###
231             'test-assembler-mips.cc',
232             'test-code-stubs.cc',
233             'test-code-stubs-mips.cc',
234             'test-disasm-mips.cc',
235             'test-macro-assembler-mips.cc'
236           ],
237         }],
238         ['v8_target_arch=="mips64el"', {
239           'sources': [
240             'test-assembler-mips64.cc',
241             'test-code-stubs.cc',
242             'test-code-stubs-mips64.cc',
243             'test-disasm-mips64.cc',
244             'test-macro-assembler-mips64.cc'
245           ],
246         }],
247         ['v8_target_arch=="x87"', {
248           'sources': [  ### gcmole(arch:x87) ###
249             'test-assembler-x87.cc',
250             'test-code-stubs.cc',
251             'test-code-stubs-x87.cc',
252             'test-disasm-x87.cc',
253             'test-macro-assembler-x87.cc',
254             'test-log-stack-tracer.cc'
255           ],
256         }],
257         [ 'OS=="linux" or OS=="qnx"', {
258           'sources': [
259             'test-platform-linux.cc',
260           ],
261         }],
262         [ 'OS=="win"', {
263           'sources': [
264             'test-platform-win32.cc',
265           ],
266           'msvs_settings': {
267             'VCCLCompilerTool': {
268               # MSVS wants this for gay-{precision,shortest}.cc.
269               'AdditionalOptions': ['/bigobj'],
270             },
271           },
272         }],
273         ['component=="shared_library"', {
274           # cctest can't be built against a shared library, so we need to
275           # depend on the underlying static target in that case.
276           'conditions': [
277             ['v8_use_snapshot=="true" and v8_use_external_startup_data==0', {
278               'dependencies': ['../../tools/gyp/v8.gyp:v8_snapshot'],
279             }],
280             ['v8_use_snapshot=="true" and v8_use_external_startup_data==1', {
281               'dependencies': ['../../tools/gyp/v8.gyp:v8_external_snapshot'],
282             }],
283             ['v8_use_snapshot!="true"', {
284               'dependencies': ['../../tools/gyp/v8.gyp:v8_nosnapshot'],
285             }],
286           ],
287         }, {
288           'dependencies': ['../../tools/gyp/v8.gyp:v8'],
289         }],
290       ],
291     },
292     {
293       'target_name': 'resources',
294       'type': 'none',
295       'variables': {
296         'file_list': [
297            '../../tools/splaytree.js',
298            '../../tools/codemap.js',
299            '../../tools/csvparser.js',
300            '../../tools/consarray.js',
301            '../../tools/profile.js',
302            '../../tools/profile_view.js',
303            '../../tools/logreader.js',
304            'log-eq-of-logging-and-traversal.js',
305         ],
306       },
307       'actions': [
308         {
309           'action_name': 'js2c',
310           'inputs': [
311             '../../tools/js2c.py',
312             '<@(file_list)',
313           ],
314           'outputs': [
315             '<(generated_file)',
316           ],
317           'action': [
318             'python',
319             '../../tools/js2c.py',
320             '<@(_outputs)',
321             'TEST',  # type
322             '<@(file_list)',
323           ],
324         }
325       ],
326     },
327   ],
328 }