• 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/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_core_path}:cesfwk_core",
46    "${ces_native_path}:cesfwk_innerkits",
47    "//third_party/googletest:gmock_main",
48    "//third_party/googletest:gtest_main",
49  ]
50
51  external_deps = [
52    "ability_base:want",
53    "c_utils:utils",
54    "eventhandler:libeventhandler",
55    "hilog:libhilog",
56    "ipc:ipc_core",
57  ]
58}
59
60ohos_moduletest("common_event_command_publish_module_test") {
61  module_out_path = module_output_path
62
63  include_dirs = []
64
65  sources = [
66    "${tools_path}/cem/src/common_event_command.cpp",
67    "${tools_path}/cem/src/shell_command.cpp",
68    "common_event_command_publish_module_test.cpp",
69  ]
70  sources += tools_cem_mock_sources
71
72  configs = [
73    "${tools_path}/cem:tools_cem_config",
74    "${tools_path}/test/unittest/cem:tools_cem_config_mock",
75  ]
76
77  cflags = []
78  if (target_cpu == "arm") {
79    cflags += [ "-DBINDER_IPC_32BIT" ]
80  }
81
82  deps = [
83    "${ces_core_path}:cesfwk_core",
84    "${ces_native_path}:cesfwk_innerkits",
85    "//third_party/googletest:gmock_main",
86    "//third_party/googletest:gtest_main",
87  ]
88
89  external_deps = [
90    "ability_base:want",
91    "c_utils:utils",
92    "eventhandler:libeventhandler",
93    "hilog:libhilog",
94    "ipc:ipc_core",
95  ]
96}
97
98group("moduletest") {
99  testonly = true
100
101  deps = [
102    ":common_event_command_dump_module_test",
103    ":common_event_command_publish_module_test",
104  ]
105}
106