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 ] 58 59 if (ark_standalone_build || is_arkui_x) { 60 configs += [ 61 "$ark_root/assembler:arkassembler_public_config", 62 "$ark_root/libpandafile:arkfile_public_config", 63 ] 64 } 65 66 deps = [ 67 "$js_root:libark_jsruntime_test", 68 ] 69 70 foreach(file, test_js_files) { 71 deps += [ ":gen_${file}_abc" ] 72 } 73 74 if (is_ohos && is_standard_system) { 75 test_abc_dir = "/data/test" 76 } else { 77 test_abc_dir = rebase_path(target_out_dir) 78 } 79 defines = [ "MODULE_ABC_PATH=\"${test_abc_dir}/\"" ] 80 81 # hiviewdfx libraries 82 external_deps = hiviewdfx_ext_deps 83 external_deps += [ "runtime_core:libarkassembler_static" ] 84 if (!ark_standalone_build && !is_arkui_x) { 85 external_deps += [ 86 "runtime_core:arkassembler_public_headers", 87 "runtime_core:arkfile_public_headers", 88 ] 89 } 90 deps += hiviewdfx_deps 91} 92 93group("ark_execution_test") { 94 testonly = true 95 96 # deps file 97 deps = [] 98} 99 100group("host_unittest") { 101 testonly = true 102 103 # deps file 104 deps = [ ":ThreadTerminationTestAction" ] 105} 106