1# Copyright (c) 2021-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 17module_output_path = "arkcompiler/ets_runtime" 18 19host_unittest_action("HeapTrackerFirstTest") { 20 module_out_path = module_output_path 21 22 sources = [ 23 # test file 24 "heap_tracker_first_test.cpp", 25 ] 26 27 configs = [ "../../../../:ecma_test_config" ] 28 29 deps = [ 30 "$ark_third_party_root/icu/icu4c:shared_icui18n", 31 "$ark_third_party_root/icu/icu4c:shared_icuuc", 32 "../../../../:libark_jsruntime_test", 33 sdk_libc_secshared_dep, 34 ] 35 36 # hiviewdfx libraries 37 external_deps = hiviewdfx_ext_deps 38 deps += hiviewdfx_deps 39} 40 41host_unittest_action("HeapTrackerSecondTest") { 42 module_out_path = module_output_path 43 44 sources = [ 45 # test file 46 "heap_tracker_second_test.cpp", 47 ] 48 49 configs = [ "../../../../:ecma_test_config" ] 50 51 deps = [ 52 "$ark_third_party_root/icu/icu4c:shared_icui18n", 53 "$ark_third_party_root/icu/icu4c:shared_icuuc", 54 "../../../../:libark_jsruntime_test", 55 sdk_libc_secshared_dep, 56 ] 57 58 # hiviewdfx libraries 59 external_deps = hiviewdfx_ext_deps 60 deps += hiviewdfx_deps 61} 62 63host_unittest_action("HeapTrackerThirdTest") { 64 module_out_path = module_output_path 65 66 sources = [ 67 # test file 68 "heap_tracker_third_test.cpp", 69 ] 70 71 configs = [ "../../../../:ecma_test_config" ] 72 73 deps = [ 74 "$ark_third_party_root/icu/icu4c:shared_icui18n", 75 "$ark_third_party_root/icu/icu4c:shared_icuuc", 76 "../../../../:libark_jsruntime_test", 77 sdk_libc_secshared_dep, 78 ] 79 80 # hiviewdfx libraries 81 external_deps = hiviewdfx_ext_deps 82 deps += hiviewdfx_deps 83} 84 85host_unittest_action("HProfTest") { 86 module_out_path = module_output_path 87 88 sources = [ 89 # test file 90 "hprof_test.cpp", 91 ] 92 93 configs = [ "//arkcompiler/ets_runtime:ecma_test_config" ] 94 95 deps = [ 96 "$ark_third_party_root/icu/icu4c:shared_icui18n", 97 "$ark_third_party_root/icu/icu4c:shared_icuuc", 98 "//arkcompiler/ets_runtime:libark_jsruntime_test", 99 sdk_libc_secshared_dep, 100 ] 101 102 # hiviewdfx libraries 103 external_deps = hiviewdfx_ext_deps 104 deps += hiviewdfx_deps 105} 106 107host_unittest_action("HeapSamplingTest") { 108 module_out_path = module_output_path 109 110 sources = [ 111 # test file 112 "heap_sampling_test.cpp", 113 ] 114 115 configs = [ "$js_root:ecma_test_config" ] 116 117 deps = [ 118 "$ark_third_party_root/icu/icu4c:shared_icui18n", 119 "$ark_third_party_root/icu/icu4c:shared_icuuc", 120 "$js_root:libark_jsruntime_test", 121 sdk_libc_secshared_dep, 122 ] 123 124 # hiviewdfx libraries 125 external_deps = hiviewdfx_ext_deps 126 deps += hiviewdfx_deps 127} 128 129group("unittest") { 130 testonly = true 131 deps = [ 132 ":HProfTest", 133 ":HeapSamplingTest", 134 ":HeapTrackerFirstTest", 135 ":HeapTrackerSecondTest", 136 ":HeapTrackerThirdTest", 137 ] 138} 139 140group("host_unittest") { 141 testonly = true 142 deps = [ 143 ":HProfTestAction", 144 ":HeapSamplingTestAction", 145 ":HeapTrackerFirstTestAction", 146 ":HeapTrackerSecondTestAction", 147 ":HeapTrackerThirdTestAction", 148 ] 149 if (is_mac) { 150 deps -= [ 151 ":HProfTestAction", 152 ":HeapSamplingTestAction", 153 ":HeapTrackerFirstTestAction", 154 ":HeapTrackerSecondTestAction", 155 ":HeapTrackerThirdTestAction", 156 ] 157 } 158} 159