• 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("//build/test.gni")
15import("../../../time.gni")
16
17config("module_private_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    "${api_path}/include",
22    "include",
23    "${time_utils_path}/native/include",
24    "${time_service_path}/time/include",
25    "${time_service_path}",
26    "${time_service_path}/dfx/include",
27    "${time_service_path}/ipc/stub",
28    "${time_service_path}/ipc/base",
29    "${time_service_path}/timer/include",
30  ]
31}
32
33module_output_path = "time_service/native"
34
35ohos_unittest("TimeServiceTest") {
36  module_out_path = module_output_path
37
38  sources = [ "src/time_service_test.cpp" ]
39
40  configs = [ ":module_private_config" ]
41
42  deps = [
43    "${api_path}:time_client",
44    "${time_service_path}:time_system_ability_static",
45    "//third_party/googletest:gtest_main",
46    "//third_party/jsoncpp:jsoncpp",
47  ]
48
49  external_deps = [
50    "ability_base:want",
51    "ability_runtime:runtime",
52    "ability_runtime:wantagent_innerkits",
53    "access_token:libaccesstoken_sdk",
54    "access_token:libnativetoken",
55    "access_token:libtoken_setproc",
56    "c_utils:utils",
57    "common_event_service:cesfwk_innerkits",
58    "hilog:libhilog",
59    "init:libbegetutil",
60    "ipc:ipc_single",
61    "safwk:system_ability_fwk",
62    "samgr:samgr_proxy",
63  ]
64}
65
66ohos_unittest("TimeClientTest") {
67  module_out_path = module_output_path
68
69  sources = [ "src/time_client_test.cpp" ]
70
71  configs = [ ":module_private_config" ]
72
73  deps = [
74    "${api_path}:time_client",
75    "${time_service_path}:time_system_ability_static",
76    "//third_party/googletest:gtest_main",
77    "//third_party/jsoncpp:jsoncpp",
78  ]
79
80  external_deps = [
81    "ability_base:want",
82    "ability_runtime:runtime",
83    "ability_runtime:wantagent_innerkits",
84    "access_token:libaccesstoken_sdk",
85    "access_token:libnativetoken",
86    "access_token:libtoken_setproc",
87    "c_utils:utils",
88    "hilog:libhilog",
89    "init:libbegetutil",
90    "ipc:ipc_single",
91    "safwk:system_ability_fwk",
92    "samgr:samgr_proxy",
93  ]
94}
95
96ohos_unittest("TimeDfxTest") {
97  module_out_path = module_output_path
98
99  sources = [ "src/time_dfx_test.cpp" ]
100
101  configs = [ ":module_private_config" ]
102
103  deps = [
104    "${api_path}:time_client",
105    "${time_service_path}:time_system_ability_static",
106    "//third_party/googletest:gtest_main",
107  ]
108
109  external_deps = [
110    "ability_base:want",
111    "ability_runtime:runtime",
112    "ability_runtime:wantagent_innerkits",
113    "access_token:libaccesstoken_sdk",
114    "access_token:libnativetoken",
115    "access_token:libtoken_setproc",
116    "bundle_framework:appexecfwk_core",
117    "c_utils:utils",
118    "hilog:libhilog",
119    "init:libbegetutil",
120    "ipc:ipc_single",
121    "safwk:system_ability_fwk",
122    "samgr:samgr_proxy",
123  ]
124}
125
126ohos_unittest("TimePermissionTest") {
127  module_out_path = module_output_path
128
129  sources = [ "src/time_permission_test.cpp" ]
130
131  configs = [ ":module_private_config" ]
132
133  deps = [
134    "${time_utils_path}:time_utils",
135    "//third_party/googletest:gtest_main",
136    "//third_party/jsoncpp:jsoncpp",
137  ]
138
139  external_deps = [
140    "ability_base:want",
141    "ability_runtime:runtime",
142    "ability_runtime:wantagent_innerkits",
143    "c_utils:utils",
144    "hilog:libhilog",
145    "ipc:ipc_single",
146    "safwk:system_ability_fwk",
147    "samgr:samgr_proxy",
148  ]
149}
150
151group("unittest") {
152  testonly = true
153
154  deps = [
155    ":TimeClientTest",
156    ":TimeDfxTest",
157    ":TimePermissionTest",
158    ":TimeServiceTest",
159  ]
160}
161