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