1# Copyright (c) 2022 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 = 18 "//arkcompiler/ets_runtime/ecmascript/debugger/tests/single_file/" 19 20test_js_files = [ 21 "base/index", 22 "patch/index", 23] 24 25module_output_path = "arkcompiler/ets_runtime" 26 27foreach(file, test_js_files) { 28 es2abc_gen_abc("gen_${file}_abc") { 29 test_js = "${test_js_path}${file}.js" 30 test_abc = "$target_out_dir/single_file/${file}.abc" 31 32 # Only targets in this file can depend on this. 33 extra_visibility = [ ":*" ] 34 src_js = rebase_path(test_js) 35 dst_file = rebase_path(test_abc) 36 extra_args = [ "--module" ] 37 extra_args += [ "--merge-abc" ] 38 39 in_puts = [ test_js ] 40 out_puts = [ test_abc ] 41 } 42} 43 44host_unittest_action("HotReloadManagerTest") { 45 module_out_path = module_output_path 46 47 sources = [ 48 # test file 49 "hot_reload_manager_test.cpp", 50 ] 51 52 configs = [ 53 "//arkcompiler/ets_runtime:ecma_test_config", 54 "$ark_root/assembler:arkassembler_public_config", 55 "$ark_root/libpandafile:arkfile_public_config", 56 ] 57 58 deps = [ 59 "//arkcompiler/ets_runtime:libark_jsruntime_test", 60 "//arkcompiler/runtime_core/assembler:libarkassembler_static", 61 sdk_libc_secshared_dep, 62 ] 63 64 foreach(file, test_js_files) { 65 deps += [ ":gen_${file}_abc" ] 66 } 67 68 if (is_ohos && is_standard_system) { 69 test_abc_dir = "/data/test" 70 } else { 71 test_abc_dir = rebase_path(target_out_dir) 72 } 73 74 test_js_dir = rebase_path(test_js_path) 75 76 defines = [ 77 "DEBUGGER_ABC_DIR=\"${test_abc_dir}/\"", 78 "DEBUGGER_JS_DIR=\"${test_js_dir}\"", 79 ] 80} 81 82group("unittest") { 83 testonly = true 84 85 # deps file 86 deps = [ ":HotReloadManagerTest" ] 87} 88 89group("host_unittest") { 90 testonly = true 91 92 # deps file 93 deps = [ ":HotReloadManagerTestAction" ] 94} 95