1# Copyright (c) 2024 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("//build/ohos.gni") 15import("//build/test.gni") 16import("//foundation/communication/netstack/netstack_config.gni") 17 18NETSTACK_UTILS_ROOT = "$SUBSYSTEM_DIR/netstack/utils" 19 20NETSTACK_NAPI_ROOT = "$SUBSYSTEM_DIR/netstack/frameworks/js/napi/" 21 22utils_include = [ "$NETSTACK_UTILS_ROOT/log/include" ] 23 24common_external_deps = [ 25 "c_utils:utils", 26 "hilog:libhilog", 27] 28 29ohos_unittest("netstack_network_profiler_utils_test") { 30 sanitize = { 31 cfi = true 32 cfi_cross_dso = true 33 debug = false 34 } 35 36 branch_protector_ret = "pac_ret" 37 38 module_out_path = "netstack/netstack/netstack_network_profiler_utils_test" 39 40 include_dirs = [ 41 "$NETSTACK_INNERKITS_DIR/http_client/include", 42 "$NETSTACK_NAPI_ROOT/http/constant/include", 43 "$NETSTACK_NAPI_ROOT/http/options/include", 44 "$NETSTACK_UTILS_ROOT/profiler_utils/include", 45 "$NETSTACK_UTILS_ROOT/tlv_utils/include", 46 "$NETSTACK_DIR/utils/common_utils/include", 47 "$NETSTACK_NAPI_ROOT/http/http_exec/include", 48 ] 49 include_dirs += utils_include 50 51 external_deps = common_external_deps 52 external_deps += [ 53 "ability_runtime:wantagent_innerkits", 54 "curl:curl_shared", 55 "hiprofiler:libnetwork_profiler", 56 "init:libbegetutil", 57 "napi:ace_napi", 58 "time_service:time_client", 59 ] 60 61 deps = [ "$NETSTACK_DIR/utils/napi_utils:napi_utils" ] 62 63 sources = [ 64 "$NETSTACK_NAPI_ROOT/http/constant/src/constant.cpp", 65 "$NETSTACK_NAPI_ROOT/http/options/src/http_request_options.cpp", 66 "$NETSTACK_NAPI_ROOT/http/options/src/http_response.cpp", 67 "$NETSTACK_NATIVE_ROOT/http/http_client/http_client_constant.cpp", 68 "$NETSTACK_NATIVE_ROOT/http/http_client/http_client_request.cpp", 69 "$NETSTACK_NATIVE_ROOT/http/http_client/http_client_response.cpp", 70 "$NETSTACK_UTILS_ROOT/profiler_utils/src/http_client_network_message.cpp", 71 "$NETSTACK_UTILS_ROOT/profiler_utils/src/http_network_message.cpp", 72 "$NETSTACK_UTILS_ROOT/profiler_utils/src/i_network_message.cpp", 73 "$NETSTACK_UTILS_ROOT/profiler_utils/src/netstack_network_profiler.cpp", 74 "$NETSTACK_UTILS_ROOT/tlv_utils/src/tlv_utils.cpp", 75 "NetstackNetworkProfilerUtilsTest.cpp", 76 ] 77 78 part_name = "netstack" 79 subsystem_name = "communication" 80} 81 82group("unittest") { 83 testonly = true 84 deps = [ ":netstack_network_profiler_utils_test" ] 85} 86