# Copyright (c) 2023 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//build/ohos.gni") import("//build/test.gni") import("//foundation/communication/netstack/netstack_config.gni") utils_include = [ "$SUBSYSTEM_DIR/netstack/utils/common_utils/include", "$SUBSYSTEM_DIR/netstack/utils/log/include", ] common_external_deps = [ "hilog:libhilog", "napi:ace_napi", ] ohos_unittest("nethttp_unittest") { module_out_path = "netstack/netstack/nethttp_unittest" include_dirs = [ "$NETSTACK_DIR/interfaces/kits/c/net_http/include", "$NETSTACK_DIR/interfaces/kits/c/common", "$NETSTACK_DIR/interfaces/innerkits/http_client/include", "$NETSTACK_DIR/frameworks/native/http/http_client/include", "$NETSTACK_DIR/test/unittest/net_http", "$NETSTACK_DIR/test/unittest/stub", ] include_dirs += utils_include sources = [ "$NETSTACK_DIR/interfaces/kits/c/net_http/src/net_http_c.cpp", "$NETSTACK_DIR/interfaces/kits/c/common/netstack_hash_map.cpp", "NetHttpTest.cpp", "NetStackHashMapTest.cpp", ] deps = [ "$NETSTACK_INNERKITS_DIR/http_client:http_client", ] external_deps = common_external_deps external_deps += [ "curl:curl_shared", "googletest:gmock_main", "googletest:gtest_main", "googletest:gmock", ] part_name = "netstack" subsystem_name = "communication" } group("unittest") { testonly = true deps = [ ":nethttp_unittest" ] }