• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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
20utils_include = [ "$NETSTACK_UTILS_ROOT/log/include" ]
21
22common_external_deps = [
23  "bounds_checking_function:libsec_shared",
24  "c_utils:utils",
25  "hilog:libhilog",
26  "hisysevent:libhisysevent",
27]
28
29ohos_unittest("netstack_common_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/utils_unittest"
39
40  include_dirs = [ "$NETSTACK_UTILS_ROOT/common_utils/include" ]
41
42  include_dirs += utils_include
43
44  external_deps = common_external_deps
45  external_deps += [ "curl:curl_shared" ]
46
47  sources = [
48    "$NETSTACK_UTILS_ROOT/common_utils/src/netstack_apipolicy_utils.cpp",
49    "$NETSTACK_UTILS_ROOT/common_utils/src/netstack_bundle_utils.cpp",
50    "$NETSTACK_UTILS_ROOT/common_utils/src/netstack_common_utils.cpp",
51    "$NETSTACK_UTILS_ROOT/common_utils/src/netstack_hisysevent.cpp",
52    "NetStackCommonUtilsTest.cpp",
53    "netstack_hisysevent_test.cpp",
54  ]
55
56  part_name = "netstack"
57  subsystem_name = "communication"
58}
59
60group("unittest") {
61  testonly = true
62  deps = [ ":netstack_common_utils_test" ]
63}
64