• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14import("//arkcompiler/ets_runtime/js_runtime_config.gni")
15import("//arkcompiler/ets_runtime/test/test_helper.gni")
16
17module_output_path = "ets_runtime"
18
19host_unittest_action("AssemblerTest") {
20  module_out_path = module_output_path
21
22  sources = [
23    # test file
24    "../assembler/tests/assembler_aarch64_test.cpp",
25    "../assembler/tests/assembler_x64_test.cpp",
26  ]
27
28  deps = [
29    "$ark_root/libpandafile:libarkfile_static",
30    "$js_root:libark_jsruntime_test_set",
31    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
32  ]
33
34  # hiviewdfx libraries
35  external_deps = hiviewdfx_ext_deps
36  deps += hiviewdfx_deps
37}
38
39host_unittest_action("TypedArrayLoweringTest") {
40  module_out_path = module_output_path
41
42  sources = [
43    # test file
44    "typed_array_lowering_test.cpp",
45  ]
46
47  deps = [
48    "$ark_root/libpandafile:libarkfile_static",
49    "$js_root:libark_jsruntime_test_set",
50    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
51  ]
52  external_deps = [ "zlib:libz" ]
53}
54
55host_unittest_action("DeadCodeEliminationTest") {
56  module_out_path = module_output_path
57
58  sources = [
59    # test file
60    "dead_code_elimination_test.cpp",
61  ]
62
63  deps = [
64    "$ark_root/libpandafile:libarkfile_static",
65    "$js_root:libark_jsruntime_test_set",
66    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
67  ]
68}
69
70host_unittest_action("CombinedPassVisitorTest") {
71  module_out_path = module_output_path
72
73  sources = [
74    # test file
75    "combined_pass_visitor_test.cpp",
76  ]
77
78  deps = [
79    "$ark_root/libpandafile:libarkfile_static",
80    "$js_root:libark_jsruntime_test_set",
81    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
82  ]
83}
84
85host_unittest_action("LoopOptimizationTest") {
86  module_out_path = module_output_path
87
88  sources = [
89    # test file
90    "loop_optimization_test.cpp",
91  ]
92
93  deps = [
94    "$ark_root/libpandafile:libarkfile_static",
95    "$js_root:libark_jsruntime_test_set",
96    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
97  ]
98  external_deps = [ "zlib:libz" ]
99}
100
101host_unittest_action("ConstantFoldingTest") {
102  module_out_path = module_output_path
103
104  sources = [
105    # test file
106    "constant_folding_test.cpp",
107  ]
108
109  deps = [
110    "$ark_root/libpandafile:libarkfile_static",
111    "$js_root:libark_jsruntime_test_set",
112    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
113  ]
114  external_deps = [ "zlib:libz" ]
115}
116
117host_unittest_action("GlobalValueNumberingTest") {
118  module_out_path = module_output_path
119
120  sources = [
121    # test file
122    "global_value_numbering_test.cpp",
123    "meta_data_equal_test.cpp",
124  ]
125
126  deps = [
127    "$ark_root/libpandafile:libarkfile_static",
128    "$js_root:libark_jsruntime_test_set",
129    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
130  ]
131  external_deps = [ "zlib:libz" ]
132}
133
134host_unittest_action("InstructionCombineTest") {
135  module_out_path = module_output_path
136
137  sources = [
138    # test file
139    "instruction_combine_test.cpp",
140  ]
141
142  deps = [
143    "$ark_root/libpandafile:libarkfile_static",
144    "$js_root:libark_jsruntime_test_set",
145    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
146  ]
147  external_deps = [ "zlib:libz" ]
148}
149
150host_unittest_action("CreateEmptyFileTest") {
151  module_out_path = module_output_path
152
153  sources = [
154    # test file
155    "create_empty_file_test.cpp",
156  ]
157
158  deps = [
159    "$ark_root/libpandafile:libarkfile_static",
160    "$js_root:libark_jsruntime_test_set",
161    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
162  ]
163  external_deps = [ "zlib:libz" ]
164}
165
166host_unittest_action("AotVersionTest") {
167  module_out_path = module_output_path
168
169  sources = [
170    # test file
171    "aot_version_test.cpp",
172  ]
173
174  deps = [
175    "$ark_root/libpandafile:libarkfile_static",
176    "$js_root:libark_jsruntime_test_set",
177    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
178  ]
179  external_deps = [ "zlib:libz" ]
180}
181
182host_unittest_action("NumberSpeculativeRetypeTest") {
183  module_out_path = module_output_path
184
185  sources = [
186    # test file
187    "number_speculative_retype_test.cpp",
188  ]
189
190  deps = [
191    "$ark_root/libpandafile:libarkfile_static",
192    "$js_root:libark_jsruntime_test_set",
193    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
194  ]
195  external_deps = [ "zlib:libz" ]
196}
197
198group("host_unittest") {
199  testonly = true
200
201  # deps file
202  deps = [
203    ":AotVersionTestAction",
204    ":AssemblerTestAction",
205    ":ConstantFoldingTestAction",
206    ":CreateEmptyFileTestAction",
207    ":GlobalValueNumberingTestAction",
208    ":InstructionCombineTestAction",
209    ":LoopOptimizationTestAction",
210    ":NumberSpeculativeRetypeTestAction",
211    ":TypedArrayLoweringTestAction",
212  ]
213
214  if (is_mac) {
215    deps -= [ ":AssemblerTestAction" ]
216  }
217}
218