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 module_out_path = module_output_path 32 33 include_dirs = [] 34 35 sources = [ 36 "${tools_path}/dump/src/notification_shell_command.cpp", 37 "${tools_path}/dump/src/shell_command.cpp", 38 "${tools_path}/test/mock/mock_ans_notification.cpp", 39 "notification_shell_command_dump_test.cpp", 40 ] 41 sources += tools_dump_mock_sources 42 43 configs = [ 44 "${tools_path}/dump:tools_dump_config", 45 ":tools_dump_config_mock", 46 ] 47 48 cflags = [] 49 if (target_cpu == "arm") { 50 cflags += [ "-DBINDER_IPC_32BIT" ] 51 } 52 53 deps = [ 54 "${core_path}:ans_core", 55 "${frameworks_module_ans_path}:ans_innerkits", 56 "//third_party/googletest:gmock_main", 57 "//third_party/googletest:gtest_main", 58 ] 59 60 external_deps = [ 61 "ability_base:base", 62 "ability_base:want", 63 "ability_base:zuri", 64 "access_token:libnativetoken", 65 "access_token:libtoken_setproc", 66 "c_utils:utils", 67 "common_event_service:cesfwk_innerkits", 68 "eventhandler:libeventhandler", 69 "hiviewdfx_hilog_native:libhilog", 70 "ipc:ipc_core", 71 "relational_store:native_rdb", 72 ] 73} 74 75group("unittest") { 76 testonly = true 77 78 deps = [ ":notification_shell_command_dump_test" ] 79} 80