• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("../../../../dsoftbus.gni")
15if (defined(ohos_lite)) {
16  import("//build/lite/config/component/lite_component.gni")
17  import("//build/lite/config/test.gni")
18
19  if (ohos_build_type == "debug") {
20    unittest("DiscSdkTest") {
21      output_extension = "bin"
22      output_dir = "$root_out_dir/test/unittest/dsoftbus"
23      sources = [ "disc_sdk_test.cpp" ]
24      include_dirs = [
25        "$dsoftbus_root_path/interfaces/kits/discovery",
26        "$dsoftbus_root_path/interfaces/kits/common",
27        "$dsoftbus_root_path/tests/sdk/common/include",
28      ]
29      deps = [
30        "$dsoftbus_root_path/sdk:softbus_client",
31        "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
32      ]
33    }
34  }
35} else {
36  import("//build/test.gni")
37  module_output_path = "dsoftbus/discovery"
38  ohos_unittest("DiscSdkOnlyL2Test") {
39    module_out_path = module_output_path
40    sources = [ "disc_sdk_only_l2_test.cpp" ]
41    include_dirs = [
42      "$dsoftbus_root_path/core/common/inner_communication",
43      "$dsoftbus_root_path/core/common/include",
44      "$dsoftbus_root_path/interfaces/kits/discovery",
45      "$dsoftbus_root_path/interfaces/kits/common",
46      "$dsoftbus_root_path/sdk/discovery/include",
47      "//commonlibrary/c_utils/base/include",
48      "//third_party/bounds_checking_function/include",
49      "unittest/common/",
50      "$dsoftbus_root_path/sdk/discovery/manager/include",
51      "$dsoftbus_root_path/tests/sdk/common/include",
52    ]
53    deps = [
54      "$dsoftbus_root_path/sdk:softbus_client",
55      "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
56      "//third_party/bounds_checking_function:libsec_static",
57      "//third_party/googletest:gtest_main",
58    ]
59    if (is_standard_system) {
60      external_deps = [
61        "c_utils:utils",
62        "hilog:libhilog",
63      ]
64    } else {
65      external_deps = [
66        "c_utils:utils",
67        "hilog:libhilog",
68      ]
69    }
70  }
71
72  ohos_unittest("DiscSdkTest") {
73    module_out_path = module_output_path
74    sources = [ "disc_sdk_test.cpp" ]
75    include_dirs = [
76      "$dsoftbus_root_path/core/common/inner_communication",
77      "$dsoftbus_root_path/core/common/include",
78      "$dsoftbus_root_path/interfaces/kits/discovery",
79      "$dsoftbus_root_path/interfaces/kits/common",
80      "$dsoftbus_root_path/sdk/discovery/include",
81      "//commonlibrary/c_utils/base/include",
82      "//third_party/bounds_checking_function/include",
83      "unittest/common/",
84      "$dsoftbus_root_path/sdk/discovery/manager/include",
85      "$dsoftbus_root_path/tests/sdk/common/include",
86    ]
87    deps = [
88      "$dsoftbus_root_path/sdk:softbus_client",
89      "$dsoftbus_root_path/tests/sdk/common:softbus_access_token_test",
90      "//third_party/bounds_checking_function:libsec_static",
91      "//third_party/googletest:gtest_main",
92    ]
93    if (is_standard_system) {
94      external_deps = [
95        "c_utils:utils",
96        "hilog:libhilog",
97      ]
98    } else {
99      external_deps = [
100        "c_utils:utils",
101        "hilog:libhilog",
102      ]
103    }
104  }
105
106  group("unittest") {
107    testonly = true
108    deps = [
109      ":DiscSdkOnlyL2Test",
110      ":DiscSdkTest",
111    ]
112  }
113}
114