• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022 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("//base/notification/distributed_notification_service/notification.gni")
15import("//build/test.gni")
16
17module_output_path =
18    "distributed_notification_service/distributed_notification_service/tools"
19
20config("tools_dump_config_mock") {
21  include_dirs = [
22    "${tools_path}/test/mock",
23    "${component_path}/services/ans/include",
24  ]
25}
26
27tools_dump_mock_sources =
28    [ "${tools_path}/test/mock/mock_ans_manager_stub.cpp" ]
29
30ohos_unittest("notification_shell_command_dump_test") {
31  sanitize = {
32    integer_overflow = true
33    ubsan = true
34    boundary_sanitize = true
35    cfi = true
36    cfi_cross_dso = true
37    debug = false
38  }
39  module_out_path = module_output_path
40
41  include_dirs = []
42
43  sources = [
44    "${tools_path}/dump/src/notification_shell_command.cpp",
45    "${tools_path}/dump/src/shell_command.cpp",
46    "${tools_path}/test/mock/mock_ans_notification.cpp",
47    "notification_shell_command_dump_test.cpp",
48  ]
49  sources += tools_dump_mock_sources
50
51  configs = [
52    "${tools_path}/dump:tools_dump_config",
53    ":tools_dump_config_mock",
54  ]
55
56  cflags = []
57  if (target_cpu == "arm") {
58    cflags += [ "-DBINDER_IPC_32BIT" ]
59  }
60
61  deps = [
62    "${frameworks_module_ans_path}:ans_innerkits",
63    "${services_path}/ans:ans_service_sources",
64  ]
65
66  external_deps = [
67    "ability_base:base",
68    "ability_base:want",
69    "ability_base:zuri",
70    "access_token:libnativetoken",
71    "access_token:libtoken_setproc",
72    "c_utils:utils",
73    "common_event_service:cesfwk_innerkits",
74    "eventhandler:libeventhandler",
75    "ffrt:libffrt",
76    "googletest:gmock_main",
77    "googletest:gtest_main",
78    "hilog:libhilog",
79    "ipc:ipc_core",
80    "relational_store:native_rdb",
81    "selinux_adapter:librestorecon",
82  ]
83}
84
85group("unittest") {
86  testonly = true
87
88  deps = [ ":notification_shell_command_dump_test" ]
89}
90