• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025 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")
15
16module_output_path = "safwk/safwk"
17
18config("svc_test_config") {
19  include_dirs = [
20    "../../../svc/include",
21    "../../../services/safwk/include",
22    "../../services/safwk/unittest",
23  ]
24}
25
26ohos_unittest("SvcTest") {
27  module_out_path = module_output_path
28
29  sources = [
30    "../../../svc/src/svc_control.cpp",
31    "src/svc_test.cpp",
32  ]
33
34  configs = [
35    "../../resource:coverage_flags",
36    ":svc_test_config",
37  ]
38
39  external_deps = [
40    "c_utils:utils",
41    "googletest:gtest_main",
42    "hilog:libhilog",
43    "ipc:ipc_single",
44    "json:nlohmann_json_static",
45    "samgr:samgr_common",
46    "samgr:samgr_proxy",
47  ]
48
49  if (target_cpu == "arm") {
50    cflags = [ "-DBINDER_IPC_32BIT" ]
51  }
52}
53
54ohos_executable("svc_test") {
55  testonly = true
56
57  sources = [
58    "../../../svc/src/svc_control.cpp",
59    "src/svc_control_test.cpp",
60  ]
61
62  include_dirs = [ "include" ]
63  configs = [
64    "../../resource:coverage_flags",
65    ":svc_test_config",
66  ]
67
68  external_deps = [
69    "c_utils:utils",
70    "hilog:libhilog",
71    "ipc:ipc_single",
72    "json:nlohmann_json_static",
73    "samgr:samgr_common",
74    "samgr:samgr_proxy",
75  ]
76
77  if (target_cpu == "arm") {
78    cflags = [ "-DBINDER_IPC_32BIT" ]
79  }
80
81  part_name = "safwk"
82  subsystem_name = "systemabilitymgr"
83}
84
85group("unittest") {
86  testonly = true
87  deps = [
88    ":SvcTest",
89    ":svc_test",
90  ]
91}
92