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_runtime/js_runtime_config.gni") 15import("//arkcompiler/ets_runtime/test/test_helper.gni") 16 17test_js_path = "//arkcompiler/ets_runtime/test/executiontest/js/" 18 19test_js_files = [ 20 "termination_1", 21 "termination_2", 22 "termination_3", 23 "termination_4", 24 "termination_5", 25 "termination_6", 26] 27 28foreach(file, test_js_files) { 29 es2abc_gen_abc("gen_${file}_abc") { 30 test_js = "${test_js_path}${file}.js" 31 test_abc = "$target_out_dir/${file}.abc" 32 33 # Only targets in this file can depend on this. 34 extra_visibility = [ ":*" ] 35 src_js = rebase_path(test_js) 36 dst_file = rebase_path(test_abc) 37 extra_args = [] 38 extra_args += [ "--module" ] 39 extra_args += [ "--merge-abc" ] 40 in_puts = [ test_js ] 41 out_puts = [ test_abc ] 42 } 43} 44 45module_output_path = "ets_runtime" 46 47host_unittest_action("ThreadTerminationTest") { 48 module_out_path = module_output_path 49 50 sources = [ 51 # test file 52 "thread_termination_test.cpp", 53 ] 54 55 configs = [ 56 "$js_root:ecma_test_config", 57 "$ark_root/assembler:arkassembler_public_config", 58 "$ark_root/libpandafile:arkfile_public_config", 59 ] 60 61 deps = [ 62 "$ark_root/assembler:libarkassembler_static", 63 "$js_root:libark_jsruntime_test", 64 ] 65 66 foreach(file, test_js_files) { 67 deps += [ ":gen_${file}_abc" ] 68 } 69 70 if (is_ohos && is_standard_system) { 71 test_abc_dir = "/data/test" 72 } else { 73 test_abc_dir = rebase_path(target_out_dir) 74 } 75 defines = [ "MODULE_ABC_PATH=\"${test_abc_dir}/\"" ] 76 77 # hiviewdfx libraries 78 external_deps = hiviewdfx_ext_deps 79 deps += hiviewdfx_deps 80} 81 82group("ark_execution_test") { 83 testonly = true 84 85 # deps file 86 deps = [] 87} 88 89group("host_unittest") { 90 testonly = true 91 92 # deps file 93 deps = [ ":ThreadTerminationTestAction" ] 94} 95