• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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("../../soc_perf.gni")
16
17module_output_path = "soc_perf/soc_perf"
18
19config("module_private_config") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    "${socperf_common}/include",
24    "${socperf_interfaces}/inner_api/socperf_client/include",
25    "${socperf_services}/core/include",
26    "${socperf_services}/server/include",
27  ]
28}
29
30ohos_unittest("SocPerfServerTest") {
31  module_out_path = module_output_path
32
33  sources = [
34    "mock/mock_accesstoken_kit.cpp",
35    "mock/mock_system_ability.cpp",
36    "socperf_server_test.cpp",
37  ]
38
39  configs = [ ":module_private_config" ]
40
41  deps = [
42    "${socperf_interfaces}/inner_api/socperf_client:socperf_stub",
43    "${socperf_services}:socperf_server_static",
44  ]
45
46  external_deps = [
47    "access_token:libaccesstoken_sdk",
48    "access_token:libtokenid_sdk",
49    "c_utils:utils",
50    "eventhandler:libeventhandler",
51    "ffrt:libffrt",
52    "hilog:libhilog",
53    "ipc:ipc_single",
54    "libxml2:libxml2",
55    "safwk:system_ability_fwk",
56    "samgr:samgr_proxy",
57  ]
58
59  sanitize = {
60    cfi = true
61    cfi_cross_dso = true
62    debug = false
63  }
64  branch_protector_ret = "pac_ret"
65}
66
67ohos_unittest("SocPerfSubTest") {
68  module_out_path = module_output_path
69
70  sources = [ "socperf_sub_test.cpp" ]
71
72  configs = [ ":module_private_config" ]
73
74  deps = [ "${socperf_interfaces}/inner_api/socperf_client:socperf_client" ]
75
76  external_deps = [
77    "c_utils:utils",
78    "eventhandler:libeventhandler",
79    "ffrt:libffrt",
80    "hilog:libhilog",
81    "ipc:ipc_single",
82    "libxml2:libxml2",
83    "safwk:system_ability_fwk",
84    "samgr:samgr_proxy",
85  ]
86}
87
88ohos_unittest("SocPerfSubMockTest") {
89  module_out_path = module_output_path
90
91  sources = [
92    "mock/mock_socperf_client.cpp",
93    "socperf_sub_mock_test.cpp",
94  ]
95
96  configs = [ ":module_private_config" ]
97
98  deps = [ "${socperf_interfaces}/inner_api/socperf_client:socperf_client" ]
99
100  external_deps = [
101    "c_utils:utils",
102    "eventhandler:libeventhandler",
103    "ffrt:libffrt",
104    "hilog:libhilog",
105    "ipc:ipc_single",
106    "libxml2:libxml2",
107    "safwk:system_ability_fwk",
108    "samgr:samgr_proxy",
109  ]
110}
111
112group("unittest") {
113  testonly = true
114  deps = [
115    ":SocPerfServerTest",
116    ":SocPerfSubMockTest",
117    ":SocPerfSubTest",
118  ]
119}
120