• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2023-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
18utils_include = [
19  "$SUBSYSTEM_DIR/netstack/utils/common_utils/include",
20  "$SUBSYSTEM_DIR/netstack/utils/log/include",
21  "//foundation/communication/netstack/frameworks/native/http/http_client/include",
22]
23
24common_external_deps = [
25  "c_utils:utils",
26  "hilog:libhilog",
27]
28
29ohos_unittest("http_client_unittest") {
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/http_client_unittest"
39
40  include_dirs = [ "$NETSTACK_INNERKITS_DIR/http_client/include" ]
41  include_dirs += utils_include
42
43  sources = [
44    "HttpClientErrorTest.cpp",
45    "HttpClientRequestTest.cpp",
46    "HttpClientResponseTest.cpp",
47    "HttpClientTaskTest.cpp",
48    "HttpClientTest.cpp",
49  ]
50
51  deps = [ "$NETSTACK_INNERKITS_DIR/http_client:http_client" ]
52
53  defines = []
54  external_deps = common_external_deps
55  external_deps += [
56    "cJSON:cjson",
57    "curl:curl_shared",
58    "googletest:gmock_main",
59    "openssl:libssl_shared",
60  ]
61
62  if (defined(global_parts_info) &&
63      defined(global_parts_info.communication_netmanager_base) &&
64      global_parts_info.communication_netmanager_base) {
65    external_deps += [ "netmanager_base:net_conn_manager_if" ]
66    defines += [ "HAS_NETMANAGER_BASE=1" ]
67  }
68
69  part_name = "netstack"
70  subsystem_name = "communication"
71}
72
73group("unittest") {
74  testonly = true
75  deps = [ ":http_client_unittest" ]
76}
77