1# Copyright (c) 2021 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/common_event_service/event.gni") 15import("//build/test.gni") 16 17module_output_path = "common_event_service/tools" 18 19tools_cem_mock_sources = 20 [ "${tools_path}/test/mock/mock_common_event_stub.cpp" ] 21 22ohos_moduletest("common_event_command_dump_module_test") { 23 module_out_path = module_output_path 24 25 include_dirs = [] 26 27 sources = [ 28 "${tools_path}/cem/src/common_event_command.cpp", 29 "${tools_path}/cem/src/shell_command.cpp", 30 "common_event_command_dump_module_test.cpp", 31 ] 32 sources += tools_cem_mock_sources 33 34 configs = [ 35 "${tools_path}/cem:tools_cem_config", 36 "${tools_path}/test/unittest/cem:tools_cem_config_mock", 37 ] 38 39 cflags = [] 40 if (target_cpu == "arm") { 41 cflags += [ "-DBINDER_IPC_32BIT" ] 42 } 43 44 deps = [ 45 "${ces_common_path}:libevent_common", 46 "${ces_core_path}:cesfwk_core", 47 "${ces_native_path}:cesfwk_innerkits", 48 "//third_party/googletest:gmock_main", 49 "//third_party/googletest:gtest_main", 50 ] 51 52 external_deps = [ 53 "ability_base:want", 54 "c_utils:utils", 55 "eventhandler:libeventhandler", 56 "hiviewdfx_hilog_native:libhilog", 57 "ipc:ipc_core", 58 ] 59} 60 61ohos_moduletest("common_event_command_publish_module_test") { 62 module_out_path = module_output_path 63 64 include_dirs = [] 65 66 sources = [ 67 "${tools_path}/cem/src/common_event_command.cpp", 68 "${tools_path}/cem/src/shell_command.cpp", 69 "common_event_command_publish_module_test.cpp", 70 ] 71 sources += tools_cem_mock_sources 72 73 configs = [ 74 "${tools_path}/cem:tools_cem_config", 75 "${tools_path}/test/unittest/cem:tools_cem_config_mock", 76 ] 77 78 cflags = [] 79 if (target_cpu == "arm") { 80 cflags += [ "-DBINDER_IPC_32BIT" ] 81 } 82 83 deps = [ 84 "${ces_common_path}:libevent_common", 85 "${ces_core_path}:cesfwk_core", 86 "${ces_native_path}:cesfwk_innerkits", 87 "//third_party/googletest:gmock_main", 88 "//third_party/googletest:gtest_main", 89 ] 90 91 external_deps = [ 92 "ability_base:want", 93 "c_utils:utils", 94 "eventhandler:libeventhandler", 95 "hiviewdfx_hilog_native:libhilog", 96 "ipc:ipc_core", 97 ] 98} 99 100group("moduletest") { 101 testonly = true 102 103 deps = [ 104 ":common_event_command_dump_module_test", 105 ":common_event_command_publish_module_test", 106 ] 107} 108