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 "$js_root:libark_jsruntime_test_set", 30 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 31 ] 32 33 # hiviewdfx libraries 34 external_deps = hiviewdfx_ext_deps 35 external_deps += [ "runtime_core:libarkfile_static" ] 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 "$js_root:libark_jsruntime_test_set", 49 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 50 ] 51 external_deps = [ 52 "runtime_core:libarkfile_static", 53 "zlib:libz", 54 ] 55} 56 57host_unittest_action("DeadCodeEliminationTest") { 58 module_out_path = module_output_path 59 60 sources = [ 61 # test file 62 "dead_code_elimination_test.cpp", 63 ] 64 65 deps = [ 66 "$js_root:libark_jsruntime_test_set", 67 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 68 ] 69 external_deps = [ "runtime_core:libarkfile_static" ] 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 "$js_root:libark_jsruntime_test_set", 82 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 83 ] 84 external_deps = [ "runtime_core:libarkfile_static" ] 85} 86 87host_unittest_action("LoopOptimizationTest") { 88 module_out_path = module_output_path 89 90 sources = [ 91 # test file 92 "loop_optimization_test.cpp", 93 ] 94 95 deps = [ 96 "$js_root:libark_jsruntime_test_set", 97 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 98 ] 99 external_deps = [ 100 "runtime_core:libarkfile_static", 101 "zlib:libz", 102 ] 103} 104 105host_unittest_action("ConstantFoldingTest") { 106 module_out_path = module_output_path 107 108 sources = [ 109 # test file 110 "constant_folding_test.cpp", 111 ] 112 113 deps = [ 114 "$js_root:libark_jsruntime_test_set", 115 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 116 ] 117 external_deps = [ 118 "runtime_core:libarkfile_static", 119 "zlib:libz", 120 ] 121} 122 123host_unittest_action("GlobalValueNumberingTest") { 124 module_out_path = module_output_path 125 126 sources = [ 127 # test file 128 "global_value_numbering_test.cpp", 129 "meta_data_equal_test.cpp", 130 ] 131 132 deps = [ 133 "$js_root:libark_jsruntime_test_set", 134 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 135 ] 136 external_deps = [ 137 "runtime_core:libarkfile_static", 138 "zlib:libz", 139 ] 140} 141 142host_unittest_action("InstructionCombineTest") { 143 module_out_path = module_output_path 144 145 sources = [ 146 # test file 147 "instruction_combine_test.cpp", 148 ] 149 150 deps = [ 151 "$js_root:libark_jsruntime_test_set", 152 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 153 ] 154 external_deps = [ 155 "runtime_core:libarkfile_static", 156 "zlib:libz", 157 ] 158} 159 160host_unittest_action("CreateEmptyFileTest") { 161 module_out_path = module_output_path 162 163 sources = [ 164 # test file 165 "create_empty_file_test.cpp", 166 ] 167 168 deps = [ 169 "$js_root:libark_jsruntime_test_set", 170 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 171 ] 172 external_deps = [ 173 "runtime_core:libarkfile_static", 174 "zlib:libz", 175 ] 176} 177 178host_unittest_action("AotVersionTest") { 179 module_out_path = module_output_path 180 181 sources = [ 182 # test file 183 "aot_version_test.cpp", 184 ] 185 186 deps = [ 187 "$js_root:libark_jsruntime_test_set", 188 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 189 ] 190 external_deps = [ 191 "runtime_core:libarkfile_static", 192 "zlib:libz", 193 ] 194} 195 196host_unittest_action("AotCompilerStatsTest") { 197 module_out_path = module_output_path 198 199 sources = [ 200 # test file 201 "aot_compiler_stats_test.cpp", 202 ] 203 204 deps = [ 205 "$js_root:libark_jsruntime_test_set", 206 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 207 ] 208 external_deps = [ 209 "runtime_core:libarkfile_static", 210 "zlib:libz", 211 ] 212} 213 214host_unittest_action("NumberSpeculativeRetypeTest") { 215 module_out_path = module_output_path 216 217 sources = [ 218 # test file 219 "number_speculative_retype_test.cpp", 220 ] 221 222 deps = [ 223 "$js_root:libark_jsruntime_test_set", 224 "$js_root/ecmascript/compiler:libark_jsoptimizer_set", 225 ] 226 external_deps = [ 227 "runtime_core:libarkfile_static", 228 "zlib:libz", 229 ] 230} 231 232group("host_unittest") { 233 testonly = true 234 235 # deps file 236 deps = [ 237 ":AotCompilerStatsTestAction", 238 ":AotVersionTestAction", 239 ":AssemblerTestAction", 240 ":ConstantFoldingTestAction", 241 ":CreateEmptyFileTestAction", 242 ":GlobalValueNumberingTestAction", 243 ":InstructionCombineTestAction", 244 ":LoopOptimizationTestAction", 245 ":NumberSpeculativeRetypeTestAction", 246 ":TypedArrayLoweringTestAction", 247 ] 248 249 if (is_mac) { 250 deps -= [ ":AssemblerTestAction" ] 251 } 252} 253