1# Copyright (c) 2021 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/lite/config/component/lite_component.gni")
15import("//build/test.gni")
16import("../../../../../dsoftbus.gni")
17
18module_output_path = "dsoftbus/transmission"
19dsoftbus_root_path = "../../../../.."
20
21if (defined(ohos_lite)) {
22  # L0
23  static_library("auth_session_test") {
24    sources = [ "auth_session_test.c" ]
25    include_dirs = [
26      "$dsoftbus_root_path/core/common/include",
27      "$dsoftbus_root_path/core/frame/common/include",
28      "//foundation/communication/wifi_lite/interfaces/wifiservice",
29    ]
30    deps = [ "$dsoftbus_root_path/tests/sdk:softbus_client_static" ]
31    cflags = [
32      "-Wall",
33      "-fPIC",
34      "-std=c99",
35    ]
36    ldflags = [ "-fPIC" ]
37  }
38} else {
39  # L2
40  ohos_executable("auth_session_test") {
41    sanitize = {
42      cfi = true
43      cfi_cross_dso = true
44      debug = false
45    }
46    branch_protector_ret = "pac_ret"
47
48    install_enable = true
49    sources = [ "auth_session_test.c" ]
50
51    include_dirs = [
52      "$dsoftbus_root_path/core/common/include",
53      "$dsoftbus_root_path/interfaces/inner_kits/transport",
54      "$dsoftbus_root_path/core/frame/common/include",
55
56      #"//foundation/communication/wifi_lite/interfaces/wifiservice",
57    ]
58
59    deps = [
60      "$dsoftbus_root_path/adapter:softbus_adapter",
61      "$dsoftbus_root_path/core/common:softbus_utils",
62      "$dsoftbus_root_path/tests/sdk:softbus_client_static",
63    ]
64
65    if (is_standard_system) {
66      external_deps = [ "hilog:libhilog" ]
67      part_name = "dsoftbus"
68    }
69    subsystem_name = "communication"
70  }
71}
72
73ohos_unittest("TransClientSdkAuthManagerTest") {
74  module_out_path = module_output_path
75  sources = [ "trans_sdk_auth_manager_test.cpp" ]
76
77  include_dirs = [
78    "$dsoftbus_root_path/adapter/common/include",
79    "$dsoftbus_root_path/core/common/include",
80    "$dsoftbus_root_path/sdk/transmission/ipc/include",
81    "$dsoftbus_root_path/sdk/transmission/session/include",
82    "$dsoftbus_root_path/sdk/transmission/trans_channel/auth/include",
83    "$dsoftbus_root_path/sdk/transmission/trans_channel/auth/src",
84  ]
85
86  deps = [
87    "$dsoftbus_root_path/core/common:softbus_utils",
88    "$dsoftbus_root_path/core/frame:softbus_server",
89  ]
90
91  if (is_standard_system) {
92    external_deps = [
93      "c_utils:utils",
94      "hilog:libhilog",
95    ]
96  } else {
97    external_deps = [
98      "c_utils:utils",
99      "hilog:libhilog",
100    ]
101  }
102}
103
104group("unittest") {
105  testonly = true
106  deps = [ ":TransClientSdkAuthManagerTest" ]
107}
108