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 = "distributed_notification_service/tools"
18
19config("tools_dump_config_mock") {
20  include_dirs = [
21    "//third_party/googletest/googlemock/include",
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    "//third_party/googletest:gmock_main",
64    "//third_party/googletest:gtest_main",
65  ]
66
67  external_deps = [
68    "ability_base:base",
69    "ability_base:want",
70    "ability_base:zuri",
71    "access_token:libnativetoken",
72    "access_token:libtoken_setproc",
73    "c_utils:utils",
74    "common_event_service:cesfwk_innerkits",
75    "eventhandler:libeventhandler",
76    "hilog:libhilog",
77    "ipc:ipc_core",
78    "relational_store:native_rdb",
79  ]
80}
81
82group("unittest") {
83  testonly = true
84
85  deps = [ ":notification_shell_command_dump_test" ]
86}
87