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_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 "$THIRD_PARTY_ROOT/curl/include", 47 "$NETSTACK_DIR/utils/common_utils/include", 48 "//base/startup/init/interfaces/innerkits/include/", 49 ] 50 include_dirs += utils_include 51 52 external_deps = common_external_deps 53 external_deps += [ 54 "ability_runtime:wantagent_innerkits", 55 "curl:curl_shared", 56 "hiprofiler:libnetwork_profiler", 57 "time_service:time_client", 58 ] 59 60 deps = [ "$NETSTACK_DIR/utils/napi_utils:napi_utils" ] 61 62 sources = [ 63 "$NETSTACK_NAPI_ROOT/http/constant/src/constant.cpp", 64 "$NETSTACK_NAPI_ROOT/http/options/src/http_request_options.cpp", 65 "$NETSTACK_NAPI_ROOT/http/options/src/http_response.cpp", 66 "$NETSTACK_NATIVE_ROOT/http/http_client/http_client_constant.cpp", 67 "$NETSTACK_NATIVE_ROOT/http/http_client/http_client_request.cpp", 68 "$NETSTACK_NATIVE_ROOT/http/http_client/http_client_response.cpp", 69 "$NETSTACK_UTILS_ROOT/profiler_utils/src/http_client_network_message.cpp", 70 "$NETSTACK_UTILS_ROOT/profiler_utils/src/http_network_message.cpp", 71 "$NETSTACK_UTILS_ROOT/profiler_utils/src/i_network_message.cpp", 72 "$NETSTACK_UTILS_ROOT/profiler_utils/src/netstack_network_profiler.cpp", 73 "$NETSTACK_UTILS_ROOT/tlv_utils/src/tlv_utils.cpp", 74 "NetstackNetworkProfilerUtilsTest.cpp", 75 ] 76 77 part_name = "netstack" 78 subsystem_name = "communication" 79} 80 81group("unittest") { 82 testonly = true 83 deps = [ ":netstack_network_profiler_utils_test" ] 84} 85