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 = "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("RuntimeDebuggerTest") { 45 module_out_path = module_output_path 46 47 sources = [ 48 # test file 49 "dropframe_manager_test.cpp", 50 "hot_reload_manager_test.cpp", 51 "js_debugger_test.cpp", 52 ] 53 54 configs = [ 55 "//arkcompiler/ets_runtime:ecma_test_config", 56 "$ark_root/assembler:arkassembler_public_config", 57 "$ark_root/libpandafile:arkfile_public_config", 58 ] 59 60 deps = [ 61 "$js_root:libark_jsruntime_test", 62 "//arkcompiler/runtime_core/assembler:libarkassembler_static", 63 ] 64 65 foreach(file, test_js_files) { 66 deps += [ ":gen_${file}_abc" ] 67 } 68 69 if (is_ohos && is_standard_system) { 70 test_abc_dir = "/data/test" 71 } else { 72 test_abc_dir = rebase_path(target_out_dir) 73 } 74 75 test_js_dir = rebase_path(test_js_path) 76 77 defines = [ 78 "DEBUGGER_ABC_DIR=\"${test_abc_dir}/\"", 79 "DEBUGGER_JS_DIR=\"${test_js_dir}\"", 80 ] 81 82 # hiviewdfx libraries 83 external_deps = hiviewdfx_ext_deps 84 deps += hiviewdfx_deps 85} 86 87group("unittest") { 88 testonly = true 89 90 # deps file 91 deps = [ ":RuntimeDebuggerTest" ] 92} 93 94group("host_unittest") { 95 testonly = true 96 97 # deps file 98 deps = [ ":RuntimeDebuggerTestAction" ] 99} 100