• 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 = "arkcompiler/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    sdk_libc_secshared_dep,
33  ]
34
35  # hiviewdfx libraries
36  external_deps = hiviewdfx_ext_deps
37  deps += hiviewdfx_deps
38}
39
40host_unittest_action("TypedArrayLoweringTest") {
41  module_out_path = module_output_path
42
43  sources = [
44    # test file
45    "typed_array_lowering_test.cpp",
46  ]
47
48  deps = [
49    "$ark_root/libpandafile:libarkfile_static",
50    "$js_root:libark_jsruntime_test_set",
51    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
52    sdk_libc_secshared_dep,
53  ]
54}
55
56host_unittest_action("DeadCodeEliminationTest") {
57  module_out_path = module_output_path
58
59  sources = [
60    # test file
61    "dead_code_elimination_test.cpp",
62  ]
63
64  deps = [
65    "$ark_root/libpandafile:libarkfile_static",
66    "$js_root:libark_jsruntime_test_set",
67    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
68    sdk_libc_secshared_dep,
69  ]
70}
71
72host_unittest_action("CombinedPassVisitorTest") {
73  module_out_path = module_output_path
74
75  sources = [
76    # test file
77    "combined_pass_visitor_test.cpp",
78  ]
79
80  deps = [
81    "$ark_root/libpandafile:libarkfile_static",
82    "$js_root:libark_jsruntime_test_set",
83    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
84    sdk_libc_secshared_dep,
85  ]
86}
87
88host_unittest_action("LoopOptimizationTest") {
89  module_out_path = module_output_path
90
91  sources = [
92    # test file
93    "loop_optimization_test.cpp",
94  ]
95
96  deps = [
97    "$ark_root/libpandafile:libarkfile_static",
98    "$js_root:libark_jsruntime_test_set",
99    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
100    sdk_libc_secshared_dep,
101  ]
102}
103
104host_unittest_action("ConstantFoldingTest") {
105  module_out_path = module_output_path
106
107  sources = [
108    # test file
109    "constant_folding_test.cpp",
110  ]
111
112  deps = [
113    "$ark_root/libpandafile:libarkfile_static",
114    "$js_root:libark_jsruntime_test_set",
115    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
116    sdk_libc_secshared_dep,
117  ]
118}
119
120host_unittest_action("GlobalValueNumberingTest") {
121  module_out_path = module_output_path
122
123  sources = [
124    # test file
125    "global_value_numbering_test.cpp",
126    "meta_data_equal_test.cpp",
127  ]
128
129  deps = [
130    "$ark_root/libpandafile:libarkfile_static",
131    "$js_root:libark_jsruntime_test_set",
132    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
133    sdk_libc_secshared_dep,
134  ]
135}
136
137host_unittest_action("InstructionCombineTest") {
138  module_out_path = module_output_path
139
140  sources = [
141    # test file
142    "instruction_combine_test.cpp",
143  ]
144
145  deps = [
146    "$ark_root/libpandafile:libarkfile_static",
147    "$js_root:libark_jsruntime_test_set",
148    "$js_root/ecmascript/compiler:libark_jsoptimizer_set",
149    sdk_libc_secshared_dep,
150  ]
151}
152
153group("host_unittest") {
154  testonly = true
155
156  # deps file
157  deps = [
158    ":AssemblerTestAction",
159    ":ConstantFoldingTestAction",
160    ":GlobalValueNumberingTestAction",
161    ":InstructionCombineTestAction",
162    ":LoopOptimizationTestAction",
163    ":TypedArrayLoweringTestAction",
164  ]
165
166  if (is_mac) {
167    deps -= [ ":AssemblerTestAction" ]
168  }
169}
170