1# Copyright (c) 2023 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_frontend/es2panda/es2abc_config.gni") 15import("//arkcompiler/runtime_core/ark_config.gni") 16import("$ark_root/tests/test_helper.gni") 17 18compiler_test_configs = [ 19 "$ark_root:ark_config", 20 "$ark_root/assembler:arkassembler_public_config", 21 "$ark_root/bytecode_optimizer:bytecodeopt_public_config", 22 "$ark_root/compiler:arkcompiler_public_config", 23 "$ark_root/libpandabase:arkbase_public_config", 24 "$ark_root/libpandafile:arkfile_public_config", 25 sdk_libc_secshared_config, 26] 27 28compiler_test_deps = [ 29 "$ark_root/assembler:libarkassembler", 30 "$ark_root/bytecode_optimizer:libarkbytecodeopt", 31 "$ark_root/compiler:libarkcompiler", 32 "$ark_root/libpandabase:libarkbase", 33 "$ark_root/libpandafile:libarkfile", 34 sdk_libc_secshared_dep, 35] 36 37test_js_path = "//arkcompiler/runtime_core/compiler/tests/js/" 38 39# graph interface unit tests 40graph_test_js_files = [ 41 "cleanUpTest", 42 "nestedTryCatch", 43 "regallocTest", 44 "regallocTryTest", 45 "simpleTryCatch", 46 "moduleTryCatch", 47 "styleTryCatch", 48 "dominatorsTryCatch", 49 "testTryCatch", 50] 51 52foreach(file, graph_test_js_files) { 53 es2abc_gen_abc("gen_${file}_abc") { 54 test_js = "${test_js_path}${file}.js" 55 test_abc = "$target_out_dir/${file}.abc" 56 57 src_js = rebase_path(test_js) 58 dst_file = rebase_path(test_abc) 59 60 in_puts = [ test_js ] 61 out_puts = [ test_abc ] 62 } 63} 64 65host_unittest_action("GraphInterfaceTest") { 66 module_out_path = module_output_path 67 sources = [ 68 "compiler_basicblock_test.cpp", 69 "compiler_graph_test.cpp", 70 "compiler_inst_test.cpp", 71 "compiler_optimizations_test.cpp", 72 "dominators_tree_new_test.cpp", 73 "dump_test.cpp", 74 "graph_checker_test.cpp", 75 "irBuilder_tests.cpp", 76 "linear_order_new_test.cpp", 77 "liveness_analyzer_new_test.cpp", 78 "loop_analyzer_new_test.cpp", 79 ] 80 configs = compiler_test_configs 81 deps = compiler_test_deps 82 83 test_abc_dir = rebase_path(target_out_dir) 84 85 defines = [ "GRAPH_TEST_ABC_DIR=\"${test_abc_dir}/\"" ] 86 87 foreach(file, graph_test_js_files) { 88 deps += [ ":gen_${file}_abc" ] 89 } 90} 91 92group("host_unittest") { 93 testonly = true 94 deps = [ ":GraphInterfaceTestAction" ] 95} 96