• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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/test.gni")
15import("//foundation/communication/netmanager_base/netmanager_base_config.gni")
16
17ohos_unittest("net_stats_manager_test") {
18  module_out_path = "netmanager_base/net_stats_manager_test"
19
20  sources = [
21    "data_flow_statistics_test.cpp",
22    "net_stats_callback_ipc_test.cpp",
23    "net_stats_callback_test.cpp",
24    "net_stats_client_test.cpp",
25    "net_stats_info_test.cpp",
26    "net_stats_service_test.cpp",
27    "net_stats_wrapper_test.cpp",
28  ]
29
30  include_dirs = [
31    "$INNERKITS_ROOT/netstatsclient/include",
32    "$NETCONNMANAGER_COMMON_DIR/include",
33    "$NETSTATSMANAGER_SOURCE_DIR/include/stub",
34    "$NETSTATSMANAGER_SOURCE_DIR/include",
35    "$NETSYSCONTROLLER_ROOT_DIR/include",
36    "$NETSTATSMANAGER_BPFLIB_DIR/include",
37    "$NETSYSBPFMAP_SOURCE_DIR/include",
38    "$NETMANAGER_BASE_ROOT/services/common/include",
39  ]
40
41  deps = [
42    "$INNERKITS_ROOT/netstatsclient:net_stats_manager_if",
43    "$NETCONNMANAGER_COMMON_DIR:net_service_common",
44    "$NETMANAGER_BASE_ROOT/services/netstatsmanager:net_stats_manager",
45    "$NETMANAGER_BASE_ROOT/utils:net_manager_common",
46    "$NETSTATSMANAGER_BPFLIB_DIR:netsys_bpf_stats",
47    "$NETSYSCONTROLLER_ROOT_DIR:netsys_controller",
48    "$THIRD_PARTY_ROOT/sqlite:sqlite",
49    "//base/hiviewdfx/hilog/interfaces/native/innerkits:libhilog",
50  ]
51
52  external_deps = [
53    "c_utils:utils",
54    "ipc:ipc_core",
55    "safwk:system_ability_fwk",
56  ]
57
58  defines = [
59    "NETMGR_LOG_TAG = \"NetStatsClient\"",
60    "LOG_DOMAIN = 0xD0015B0",
61  ]
62
63  if (enable_netmgr_debug) {
64    defines += [ "NETMGR_DEBUG" ]
65  }
66
67  if (is_standard_system) {
68    external_deps += [ "hiviewdfx_hilog_native:libhilog" ]
69  } else {
70    external_deps += [ "hilog:libhilog" ]
71  }
72
73  part_name = "netmanager_base"
74  subsystem_name = "communication"
75}
76