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 18#module_out_path = "$ark_root/assembler" 19 20config("module_private_config") { 21 visibility = [ ":*" ] 22 include_dirs = [ 23 "$ark_root/assembler", 24 "$target_gen_dir", 25 "$target_gen_dir/include", 26 "$root_gen_dir/libpandabase", 27 "$ark_root", 28 "$ark_root/plugins/ecmascript/assembler", 29 ] 30 31 defines = [ "PANDA_WITH_ECMASCRIPT" ] 32} 33 34assembler_test_js_files = [ "test_class_access_flags" ] 35 36test_js_path = "//arkcompiler/runtime_core/assembler/tests/js/" 37 38foreach(file, assembler_test_js_files) { 39 es2abc_gen_abc("gen_${file}_abc") { 40 test_js = "${test_js_path}${file}.js" 41 test_abc = "$target_out_dir/${file}.abc" 42 43 src_js = rebase_path(test_js) 44 dst_file = rebase_path(test_abc) 45 46 extra_args = [ "--merge-abc" ] 47 48 in_puts = [ test_js ] 49 out_puts = [ test_abc ] 50 } 51} 52 53host_unittest_action("AssemblerTest") { 54 module_out_path = module_output_path 55 56 sources = [ 57 "annotation_test.cpp", 58 "assembler_access_flag_test.cpp", 59 "assembler_emitter_test.cpp", 60 "assembler_ins_test.cpp", 61 "assembler_lexer_test.cpp", 62 "assembler_mangling_test.cpp", 63 "assembler_parser_test.cpp", 64 "ecmascript_meta_test.cpp", 65 ] 66 67 configs = [ 68 ":module_private_config", 69 "$ark_root:ark_config", 70 "$ark_root/assembler:arkassembler_public_config", 71 "$ark_root/libpandabase:arkbase_public_config", 72 "$ark_root/libpandafile:arkfile_public_config", 73 "$ark_root/compiler:arkcompiler_public_config", 74 "$ark_root/bytecode_optimizer:bytecodeopt_public_config", 75 sdk_libc_secshared_config, 76 ] 77 78 deps = [ 79 "$ark_root/assembler:libarkassembler", 80 "$ark_root/bytecode_optimizer:libarkbytecodeopt", 81 "$ark_root/compiler:libarkcompiler", 82 "$ark_root/libpandabase:libarkbase", 83 "$ark_root/libpandafile:libarkfile", 84 "$ark_root/libziparchive:libarkziparchive", 85 "//third_party/googletest:gtest_main", 86 ] 87 88 external_deps = [ sdk_libc_secshared_dep ] 89 test_abc_dir = rebase_path(target_out_dir) 90 defines = [ "GRAPH_TEST_ABC_DIR=\"${test_abc_dir}/\"" ] 91 foreach(file, assembler_test_js_files) { 92 deps += [ ":gen_${file}_abc" ] 93 } 94} 95 96group("host_unittest") { 97 testonly = true 98 deps = [ ":AssemblerTestAction" ] 99} 100