• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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("//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]
22
23common_external_deps = [
24  "hilog:libhilog",
25  "napi:ace_napi",
26]
27
28ohos_unittest("nethttp_unittest") {
29  module_out_path = "netstack/netstack/nethttp_unittest"
30
31  include_dirs = [
32    "$NETSTACK_DIR/interfaces/kits/c/net_http/include",
33    "$NETSTACK_DIR/interfaces/kits/c/common",
34    "$NETSTACK_DIR/interfaces/innerkits/http_client/include",
35    "$NETSTACK_DIR/frameworks/native/http/http_client/include",
36    "$NETSTACK_DIR/test/unittest/net_http",
37    "$NETSTACK_DIR/test/unittest/stub",
38  ]
39  include_dirs += utils_include
40
41  sources = [
42    "$NETSTACK_DIR/interfaces/kits/c/net_http/src/net_http_c.cpp",
43    "$NETSTACK_DIR/interfaces/kits/c/common/netstack_hash_map.cpp",
44    "NetHttpTest.cpp",
45    "NetStackHashMapTest.cpp",
46  ]
47
48  deps = [
49    "$NETSTACK_INNERKITS_DIR/http_client:http_client",
50    ]
51
52  external_deps = common_external_deps
53  external_deps += [
54    "curl:curl_shared",
55    "googletest:gmock_main",
56    "googletest:gtest_main",
57    "googletest:gmock",
58  ]
59
60  part_name = "netstack"
61  subsystem_name = "communication"
62}
63
64group("unittest") {
65  testonly = true
66  deps = [ ":nethttp_unittest" ]
67}