1# Copyright 2014 the V8 project authors. All rights reserved.
2# Use of this source code is governed by a BSD-style license that can be
3# found in the LICENSE file.
4
5# Please keep this file in sync with BUILD.gn.
6
7{
8  'variables': {
9    'v8_code': 1,
10  },
11  'includes': ['../../gypfiles/toolchain.gypi', '../../gypfiles/features.gypi'],
12  'targets': [
13    {
14      'target_name': 'unittests',
15      'type': 'executable',
16      'variables': {
17        'optimize': 'max',
18      },
19      'dependencies': [
20        '../../testing/gmock.gyp:gmock',
21        '../../testing/gtest.gyp:gtest',
22        '../../src/v8.gyp:v8_libplatform',
23      ],
24      'include_dirs': [
25        '../..',
26      ],
27      'sources': [  ### gcmole(all) ###
28        'base/atomic-utils-unittest.cc',
29        'base/bits-unittest.cc',
30        'base/cpu-unittest.cc',
31        'base/division-by-constant-unittest.cc',
32        'base/flags-unittest.cc',
33        'base/functional-unittest.cc',
34        'base/ieee754-unittest.cc',
35        'base/logging-unittest.cc',
36        'base/iterator-unittest.cc',
37        'base/platform/condition-variable-unittest.cc',
38        'base/platform/mutex-unittest.cc',
39        'base/platform/platform-unittest.cc',
40        'base/platform/semaphore-unittest.cc',
41        'base/platform/time-unittest.cc',
42        'base/sys-info-unittest.cc',
43        'base/utils/random-number-generator-unittest.cc',
44        'cancelable-tasks-unittest.cc',
45        'char-predicates-unittest.cc',
46        'compiler/branch-elimination-unittest.cc',
47        'compiler/checkpoint-elimination-unittest.cc',
48        'compiler/common-operator-reducer-unittest.cc',
49        'compiler/common-operator-unittest.cc',
50        'compiler/compiler-test-utils.h',
51        'compiler/control-equivalence-unittest.cc',
52        'compiler/control-flow-optimizer-unittest.cc',
53        'compiler/dead-code-elimination-unittest.cc',
54        'compiler/diamond-unittest.cc',
55        'compiler/effect-control-linearizer-unittest.cc',
56        'compiler/escape-analysis-unittest.cc',
57        'compiler/graph-reducer-unittest.cc',
58        'compiler/graph-reducer-unittest.h',
59        'compiler/graph-trimmer-unittest.cc',
60        'compiler/graph-unittest.cc',
61        'compiler/graph-unittest.h',
62        'compiler/instruction-selector-unittest.cc',
63        'compiler/instruction-selector-unittest.h',
64        'compiler/instruction-sequence-unittest.cc',
65        'compiler/instruction-sequence-unittest.h',
66        'compiler/int64-lowering-unittest.cc',
67        'compiler/js-builtin-reducer-unittest.cc',
68        'compiler/js-create-lowering-unittest.cc',
69        'compiler/js-intrinsic-lowering-unittest.cc',
70        'compiler/js-operator-unittest.cc',
71        'compiler/js-typed-lowering-unittest.cc',
72        'compiler/linkage-tail-call-unittest.cc',
73        'compiler/liveness-analyzer-unittest.cc',
74        'compiler/live-range-unittest.cc',
75        'compiler/load-elimination-unittest.cc',
76        'compiler/loop-peeling-unittest.cc',
77        'compiler/machine-operator-reducer-unittest.cc',
78        'compiler/machine-operator-unittest.cc',
79        'compiler/move-optimizer-unittest.cc',
80        'compiler/node-cache-unittest.cc',
81        'compiler/node-matchers-unittest.cc',
82        'compiler/node-properties-unittest.cc',
83        'compiler/node-test-utils.cc',
84        'compiler/node-test-utils.h',
85        'compiler/node-unittest.cc',
86        'compiler/opcodes-unittest.cc',
87        'compiler/register-allocator-unittest.cc',
88        'compiler/schedule-unittest.cc',
89        'compiler/scheduler-unittest.cc',
90        'compiler/scheduler-rpo-unittest.cc',
91        'compiler/simplified-operator-reducer-unittest.cc',
92        'compiler/simplified-operator-unittest.cc',
93        'compiler/state-values-utils-unittest.cc',
94        'compiler/tail-call-optimization-unittest.cc',
95        'compiler/typer-unittest.cc',
96        'compiler/value-numbering-reducer-unittest.cc',
97        'compiler/zone-pool-unittest.cc',
98        'counters-unittest.cc',
99        'interpreter/bytecodes-unittest.cc',
100        'interpreter/bytecode-array-builder-unittest.cc',
101        'interpreter/bytecode-array-iterator-unittest.cc',
102        'interpreter/bytecode-array-writer-unittest.cc',
103        'interpreter/bytecode-dead-code-optimizer-unittest.cc',
104        'interpreter/bytecode-peephole-optimizer-unittest.cc',
105        'interpreter/bytecode-pipeline-unittest.cc',
106        'interpreter/bytecode-register-allocator-unittest.cc',
107        'interpreter/bytecode-register-optimizer-unittest.cc',
108        'interpreter/constant-array-builder-unittest.cc',
109        'interpreter/interpreter-assembler-unittest.cc',
110        'interpreter/interpreter-assembler-unittest.h',
111        'interpreter/source-position-table-unittest.cc',
112        'libplatform/default-platform-unittest.cc',
113        'libplatform/task-queue-unittest.cc',
114        'libplatform/worker-thread-unittest.cc',
115        'heap/bitmap-unittest.cc',
116        'heap/gc-idle-time-handler-unittest.cc',
117        'heap/gc-tracer-unittest.cc',
118        'heap/memory-reducer-unittest.cc',
119        'heap/heap-unittest.cc',
120        'heap/scavenge-job-unittest.cc',
121        'heap/slot-set-unittest.cc',
122        'locked-queue-unittest.cc',
123        'register-configuration-unittest.cc',
124        'run-all-unittests.cc',
125        'test-utils.h',
126        'test-utils.cc',
127        'wasm/asm-types-unittest.cc',
128        'wasm/ast-decoder-unittest.cc',
129        'wasm/control-transfer-unittest.cc',
130        'wasm/decoder-unittest.cc',
131        'wasm/encoder-unittest.cc',
132        'wasm/leb-helper-unittest.cc',
133        'wasm/loop-assignment-analysis-unittest.cc',
134        'wasm/module-decoder-unittest.cc',
135        'wasm/switch-logic-unittest.cc',
136        'wasm/wasm-macro-gen-unittest.cc',
137      ],
138      'conditions': [
139        ['v8_target_arch=="arm"', {
140          'sources': [  ### gcmole(arch:arm) ###
141            'compiler/arm/instruction-selector-arm-unittest.cc',
142          ],
143        }],
144        ['v8_target_arch=="arm64"', {
145          'sources': [  ### gcmole(arch:arm64) ###
146            'compiler/arm64/instruction-selector-arm64-unittest.cc',
147          ],
148        }],
149        ['v8_target_arch=="ia32"', {
150          'sources': [  ### gcmole(arch:ia32) ###
151            'compiler/ia32/instruction-selector-ia32-unittest.cc',
152          ],
153        }],
154        ['v8_target_arch=="mips"', {
155          'sources': [  ### gcmole(arch:mips) ###
156            'compiler/mips/instruction-selector-mips-unittest.cc',
157          ],
158        }],
159        ['v8_target_arch=="mipsel"', {
160          'sources': [  ### gcmole(arch:mipsel) ###
161            'compiler/mips/instruction-selector-mips-unittest.cc',
162          ],
163        }],
164        ['v8_target_arch=="mips64"', {
165          'sources': [  ### gcmole(arch:mips64) ###
166            'compiler/mips64/instruction-selector-mips64-unittest.cc',
167          ],
168        }],
169        ['v8_target_arch=="mips64el"', {
170          'sources': [  ### gcmole(arch:mips64el) ###
171            'compiler/mips64/instruction-selector-mips64-unittest.cc',
172          ],
173        }],
174        ['v8_target_arch=="x64"', {
175          'sources': [  ### gcmole(arch:x64) ###
176            'compiler/x64/instruction-selector-x64-unittest.cc',
177          ],
178        }],
179        ['v8_target_arch=="ppc" or v8_target_arch=="ppc64"', {
180          'sources': [  ### gcmole(arch:ppc) ###
181            'compiler/ppc/instruction-selector-ppc-unittest.cc',
182          ],
183        }],
184        ['v8_target_arch=="s390" or v8_target_arch=="s390x"', {
185          'sources': [  ### gcmole(arch:s390) ###
186            'compiler/s390/instruction-selector-s390-unittest.cc',
187          ],
188        }],
189        ['OS=="aix"', {
190          'ldflags': [ '-Wl,-bbigtoc' ],
191        }],
192        ['component=="shared_library"', {
193          # compiler-unittests can't be built against a shared library, so we
194          # need to depend on the underlying static target in that case.
195          'dependencies': ['../../src/v8.gyp:v8_maybe_snapshot'],
196        }, {
197          'dependencies': ['../../src/v8.gyp:v8'],
198        }],
199        ['os_posix == 1', {
200          # TODO(svenpanne): This is a temporary work-around to fix the warnings
201          # that show up because we use -std=gnu++0x instead of -std=c++11.
202          'cflags!': [
203            '-pedantic',
204          ],
205          'direct_dependent_settings': {
206            'cflags!': [
207              '-pedantic',
208            ],
209          },
210        }],
211      ],
212    },
213  ],
214  'conditions': [
215    ['test_isolation_mode != "noop"', {
216      'targets': [
217        {
218          'target_name': 'unittests_run',
219          'type': 'none',
220          'dependencies': [
221            'unittests',
222          ],
223          'includes': [
224            '../../gypfiles/isolate.gypi',
225          ],
226          'sources': [
227            'unittests.isolate',
228          ],
229        },
230      ],
231    }],
232  ],
233}
234