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.h',
52        'compiler/test-basic-block-profiler.cc',
53        'compiler/test-branch-combine.cc',
54        'compiler/test-changes-lowering.cc',
55        'compiler/test-code-stub-assembler.cc',
56        'compiler/test-gap-resolver.cc',
57        'compiler/test-graph-visualizer.cc',
58        'compiler/test-instruction.cc',
59        'compiler/test-js-context-specialization.cc',
60        'compiler/test-js-constant-cache.cc',
61        'compiler/test-js-typed-lowering.cc',
62        'compiler/test-jump-threading.cc',
63        'compiler/test-linkage.cc',
64        'compiler/test-loop-assignment-analysis.cc',
65        'compiler/test-loop-analysis.cc',
66        'compiler/test-machine-operator-reducer.cc',
67        'compiler/test-multiple-return.cc',
68        'compiler/test-node.cc',
69        'compiler/test-operator.cc',
70        'compiler/test-osr.cc',
71        'compiler/test-pipeline.cc',
72        'compiler/test-representation-change.cc',
73        'compiler/test-run-bytecode-graph-builder.cc',
74        'compiler/test-run-deopt.cc',
75        'compiler/test-run-inlining.cc',
76        'compiler/test-run-intrinsics.cc',
77        'compiler/test-run-jsbranches.cc',
78        'compiler/test-run-jscalls.cc',
79        'compiler/test-run-jsexceptions.cc',
80        'compiler/test-run-jsobjects.cc',
81        'compiler/test-run-jsops.cc',
82        'compiler/test-run-machops.cc',
83        'compiler/test-run-native-calls.cc',
84        'compiler/test-run-properties.cc',
85        'compiler/test-run-stackcheck.cc',
86        'compiler/test-run-stubs.cc',
87        'compiler/test-run-variables.cc',
88        'compiler/test-simplified-lowering.cc',
89        'cctest.cc',
90        'expression-type-collector.cc',
91        'expression-type-collector.h',
92        'interpreter/test-bytecode-generator.cc',
93        'interpreter/test-interpreter.cc',
94        'gay-fixed.cc',
95        'gay-precision.cc',
96        'gay-shortest.cc',
97        'heap/heap-tester.h',
98        'heap/test-alloc.cc',
99        'heap/test-compaction.cc',
100        'heap/test-heap.cc',
101        'heap/test-incremental-marking.cc',
102        'heap/test-lab.cc',
103        'heap/test-mark-compact.cc',
104        'heap/test-spaces.cc',
105        'heap/utils-inl.h',
106        'print-extension.cc',
107        'profiler-extension.cc',
108        'test-accessors.cc',
109        'test-api.cc',
110        'test-api.h',
111        'test-api-accessors.cc',
112        'test-api-interceptors.cc',
113        'test-api-fast-accessor-builder.cc',
114        'test-array-list.cc',
115        'test-ast.cc',
116        'test-ast-expression-visitor.cc',
117        'test-asm-validator.cc',
118        'test-atomicops.cc',
119        'test-bignum.cc',
120        'test-bignum-dtoa.cc',
121        'test-bit-vector.cc',
122        'test-circular-queue.cc',
123        'test-compiler.cc',
124        'test-constantpool.cc',
125        'test-conversions.cc',
126        'test-cpu-profiler.cc',
127        'test-date.cc',
128        'test-debug.cc',
129        'test-decls.cc',
130        'test-deoptimization.cc',
131        'test-dictionary.cc',
132        'test-diy-fp.cc',
133        'test-double.cc',
134        'test-dtoa.cc',
135        'test-elements-kind.cc',
136        'test-fast-dtoa.cc',
137        'test-feedback-vector.cc',
138        'test-field-type-tracking.cc',
139        'test-fixed-dtoa.cc',
140        'test-flags.cc',
141        'test-func-name-inference.cc',
142        'test-gc-tracer.cc',
143        'test-global-handles.cc',
144        'test-global-object.cc',
145        'test-hashing.cc',
146        'test-hashmap.cc',
147        'test-heap-profiler.cc',
148        'test-hydrogen-types.cc',
149        'test-identity-map.cc',
150        'test-inobject-slack-tracking.cc',
151        'test-list.cc',
152        'test-liveedit.cc',
153        'test-lockers.cc',
154        'test-log.cc',
155        'test-microtask-delivery.cc',
156        'test-mementos.cc',
157        'test-object-observe.cc',
158        'test-parsing.cc',
159        'test-platform.cc',
160        'test-profile-generator.cc',
161        'test-random-number-generator.cc',
162        'test-receiver-check-hidden-prototype.cc',
163        'test-regexp.cc',
164        'test-reloc-info.cc',
165        'test-representation.cc',
166        'test-sampler-api.cc',
167        'test-serialize.cc',
168        'test-simd.cc',
169        'test-slots-buffer.cc',
170        'test-strings.cc',
171        'test-symbols.cc',
172        'test-strtod.cc',
173        'test-thread-termination.cc',
174        'test-threads.cc',
175        'test-trace-event.cc',
176        'test-transitions.cc',
177        'test-typedarrays.cc',
178        'test-types.cc',
179        'test-typing-reset.cc',
180        'test-unbound-queue.cc',
181        'test-unboxed-doubles.cc',
182        'test-unique.cc',
183        'test-unscopables-hidden-prototype.cc',
184        'test-utils.cc',
185        'test-version.cc',
186        'test-weakmaps.cc',
187        'test-weaksets.cc',
188        'trace-extension.cc',
189        'wasm/test-run-wasm.cc',
190        'wasm/test-run-wasm-js.cc',
191        'wasm/test-run-wasm-module.cc',
192        'wasm/test-signatures.h',
193        'wasm/wasm-run-utils.h',
194      ],
195      'conditions': [
196        ['v8_target_arch=="ia32"', {
197          'sources': [  ### gcmole(arch:ia32) ###
198            'test-assembler-ia32.cc',
199            'test-code-stubs.cc',
200            'test-code-stubs-ia32.cc',
201            'test-disasm-ia32.cc',
202            'test-macro-assembler-ia32.cc',
203            'test-log-stack-tracer.cc'
204          ],
205        }],
206        ['v8_target_arch=="x64"', {
207          'sources': [  ### gcmole(arch:x64) ###
208            'test-assembler-x64.cc',
209            'test-code-stubs.cc',
210            'test-code-stubs-x64.cc',
211            'test-disasm-x64.cc',
212            'test-macro-assembler-x64.cc',
213            'test-log-stack-tracer.cc'
214          ],
215        }],
216        ['v8_target_arch=="arm"', {
217          'sources': [  ### gcmole(arch:arm) ###
218            'test-assembler-arm.cc',
219            'test-code-stubs.cc',
220            'test-code-stubs-arm.cc',
221            'test-disasm-arm.cc',
222            'test-macro-assembler-arm.cc'
223          ],
224        }],
225        ['v8_target_arch=="arm64"', {
226          'sources': [  ### gcmole(arch:arm64) ###
227            'test-utils-arm64.cc',
228            'test-assembler-arm64.cc',
229            'test-code-stubs.cc',
230            'test-code-stubs-arm64.cc',
231            'test-disasm-arm64.cc',
232            'test-fuzz-arm64.cc',
233            'test-javascript-arm64.cc',
234            'test-js-arm64-variables.cc'
235          ],
236        }],
237        ['v8_target_arch=="ppc"', {
238          'sources': [  ### gcmole(arch:ppc) ###
239            'test-assembler-ppc.cc',
240            'test-code-stubs.cc',
241            'test-disasm-ppc.cc'
242          ],
243        }],
244        ['v8_target_arch=="ppc64"', {
245          'sources': [  ### gcmole(arch:ppc64) ###
246            'test-assembler-ppc.cc',
247            'test-code-stubs.cc',
248            'test-disasm-ppc.cc'
249          ],
250        }],
251        ['v8_target_arch=="mipsel"', {
252          'sources': [  ### gcmole(arch:mipsel) ###
253            'test-assembler-mips.cc',
254            'test-code-stubs.cc',
255            'test-code-stubs-mips.cc',
256            'test-disasm-mips.cc',
257            'test-macro-assembler-mips.cc'
258          ],
259        }],
260        ['v8_target_arch=="mips64el"', {
261          'sources': [
262            'test-assembler-mips64.cc',
263            'test-code-stubs.cc',
264            'test-code-stubs-mips64.cc',
265            'test-disasm-mips64.cc',
266            'test-macro-assembler-mips64.cc'
267          ],
268        }],
269        ['v8_target_arch=="x87"', {
270          'sources': [  ### gcmole(arch:x87) ###
271            'test-assembler-x87.cc',
272            'test-code-stubs.cc',
273            'test-code-stubs-x87.cc',
274            'test-disasm-x87.cc',
275            'test-macro-assembler-x87.cc',
276            'test-log-stack-tracer.cc'
277          ],
278        }],
279        [ 'OS=="linux" or OS=="qnx"', {
280          'sources': [
281            'test-platform-linux.cc',
282          ],
283        }],
284        [ 'OS=="win"', {
285          'sources': [
286            'test-platform-win32.cc',
287          ],
288          'msvs_settings': {
289            'VCCLCompilerTool': {
290              # MSVS wants this for gay-{precision,shortest}.cc.
291              'AdditionalOptions': ['/bigobj'],
292            },
293          },
294        }],
295        ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
296          # disable fmadd/fmsub so that expected results match generated code in
297          # RunFloat64MulAndFloat64Add1 and friends.
298          'cflags': ['-ffp-contract=off'],
299        }],
300        ['OS=="aix"', {
301          'ldflags': [ '-Wl,-bbigtoc' ],
302        }],
303        ['component=="shared_library"', {
304          # cctest can't be built against a shared library, so we need to
305          # depend on the underlying static target in that case.
306          'dependencies': ['../../tools/gyp/v8.gyp:v8_maybe_snapshot'],
307        }, {
308          'dependencies': ['../../tools/gyp/v8.gyp:v8'],
309        }],
310      ],
311    },
312    {
313      'target_name': 'resources',
314      'type': 'none',
315      'variables': {
316        'file_list': [
317           '../../tools/splaytree.js',
318           '../../tools/codemap.js',
319           '../../tools/csvparser.js',
320           '../../tools/consarray.js',
321           '../../tools/profile.js',
322           '../../tools/profile_view.js',
323           '../../tools/logreader.js',
324           'log-eq-of-logging-and-traversal.js',
325        ],
326      },
327      'actions': [
328        {
329          'action_name': 'js2c',
330          'inputs': [
331            '../../tools/js2c.py',
332            '<@(file_list)',
333          ],
334          'outputs': [
335            '<(generated_file)',
336          ],
337          'action': [
338            'python',
339            '../../tools/js2c.py',
340            '<@(_outputs)',
341            'TEST',  # type
342            '<@(file_list)',
343          ],
344        }
345      ],
346    },
347  ],
348  'conditions': [
349    ['test_isolation_mode != "noop"', {
350      'targets': [
351        {
352          'target_name': 'cctest_run',
353          'type': 'none',
354          'dependencies': [
355            'cctest',
356          ],
357          'includes': [
358            '../../build/isolate.gypi',
359          ],
360          'sources': [
361            'cctest.isolate',
362          ],
363        },
364      ],
365    }],
366  ],
367}
368