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