• 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
14if (defined(ohos_lite)) {
15  import("//build/lite/config/component/lite_component.gni")
16  import("//build/lite/config/test.gni")
17  import("../../../../dsoftbus.gni")
18
19  if (ohos_build_type == "debug") {
20    unittest("SoftbusUtilsTest") {
21      output_extension = "bin"
22      output_dir = "$root_out_dir/tests/unittest/dsoftbus"
23      sources = [ "unittest/softbus_utils_test.cpp" ]
24      include_dirs = [ "$dsoftbus_root_path/core/common/include" ]
25      ldflags = [
26        "-lstdc++",
27        "-Wl,-rpath-link=$ohos_root_path/$root_out_dir",
28      ]
29      deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ]
30      external_deps = [ "hilog:libhilog" ]
31    }
32  }
33} else {
34  import("//build/test.gni")
35  import("../../../../dsoftbus.gni")
36
37  module_output_path = "dsoftbus/common"
38  ohos_unittest("SoftbusUtilsTest") {
39    module_out_path = module_output_path
40    sources = [ "unittest/softbus_utils_test.cpp" ]
41    include_dirs = [ "$dsoftbus_root_path/core/common/include" ]
42    deps = [ "$dsoftbus_root_path/core/common:softbus_utils" ]
43    external_deps = [ "hilog:libhilog" ]
44  }
45
46  ohos_unittest("Sqlite3UtilsTest") {
47    module_out_path = module_output_path
48    sources = [ "unittest/sqlite3_utils_test.cpp" ]
49
50    include_dirs = [
51      "$dsoftbus_root_path/adapter/common/include",
52      "$dsoftbus_root_path/core/common/include",
53      "$dsoftbus_root_path/interfaces/kits/bus_center",
54      "$dsoftbus_root_path/interfaces/kits/common",
55      "//commonlibrary/c_utils/base/include",
56    ]
57
58    deps = [
59      "$dsoftbus_root_path/adapter:softbus_adapter",
60      "$dsoftbus_root_path/core/common:softbus_utils",
61      "//third_party/googletest:gtest_main",
62      "//third_party/sqlite:sqlite",
63    ]
64
65    if (is_standard_system) {
66      external_deps = [
67        "c_utils:utils",
68        "hilog:libhilog",
69      ]
70    } else {
71      external_deps = [
72        "c_utils:utils",
73        "hilog:libhilog",
74      ]
75    }
76  }
77
78  group("unittest") {
79    testonly = true
80    deps = [
81      ":SoftbusUtilsTest",
82      ":Sqlite3UtilsTest",
83      "permission_state_test:PermissionStateTest",
84    ]
85  }
86}
87