• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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/ohos.gni")
15import("//build/test.gni")
16import(
17    "//foundation/resourceschedule/device_standby/standby_service.gni")
18
19module_output_path = "${standby_service_part_name}/unittest"
20
21ohos_unittest("standby_client_unit_test") {
22  module_out_path = module_output_path
23  cflags_cc = [
24    "-Dprivate=public",
25    "-Dprotected=public",
26  ]
27
28  include_dirs = [ "${standby_innerkits_path}/include" ]
29
30  sources = [ "${standby_innerkits_path}/test/unittest/standby_client_unit_test.cpp" ]
31
32  deps = [ "${standby_innerkits_path}:standby_innerkits" ]
33
34  external_deps = [
35    "ability_base:want",
36    "ability_runtime:abilitykit_native",
37    "ability_runtime:wantagent_innerkits",
38    "c_utils:utils",
39    "hilog:libhilog",
40    "ipc:ipc_single",
41    "samgr:samgr_proxy",
42  ]
43
44  subsystem_name = "resourceschedule"
45  part_name = "${standby_service_part_name}"
46}
47
48ohos_unittest("mock_standby_client_unit_test") {
49  module_out_path = module_output_path
50  cflags_cc = [
51    "-Dprivate=public",
52    "-Dprotected=public",
53  ]
54
55  include_dirs = [ "${standby_innerkits_path}/include" ]
56
57  sources = [
58    "${standby_innerkits_path}/test/unittest/mock/mock_sa_service.cpp",
59    "${standby_innerkits_path}/test/unittest/mock_standby_client_unit_test.cpp",
60  ]
61
62  deps = [ "${standby_innerkits_path}:standby_innerkits" ]
63
64  external_deps = [
65    "ability_base:want",
66    "ability_runtime:abilitykit_native",
67    "ability_runtime:wantagent_innerkits",
68    "c_utils:utils",
69    "hilog:libhilog",
70    "ipc:ipc_single",
71    "samgr:samgr_proxy",
72  ]
73
74  subsystem_name = "resourceschedule"
75  part_name = "${standby_service_part_name}"
76}
77
78group("unittest") {
79  testonly = true
80
81  deps = [
82    ":standby_client_unit_test",
83    ":mock_standby_client_unit_test",
84  ]
85}
86