• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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("//build/test.gni")
15
16native_hiappevent_path = "//base/hiviewdfx/hiappevent/frameworks/native"
17native_module_output_path = "hiappevent/native"
18
19config("hiappevent_config_test") {
20  visibility = [ ":*" ]
21
22  include_dirs = [
23    ".",
24    "//base/hiviewdfx/hiappevent/interfaces/native/kits/include",
25    "$native_hiappevent_path/libhiappevent/include",
26    "$native_hiappevent_path/libhiappevent/watcher/include",
27  ]
28}
29
30ohos_unittest("HiAppEventNativeTest") {
31  module_out_path = native_module_output_path
32
33  configs = [ ":hiappevent_config_test" ]
34
35  sources = [ "unittest/common/native/hiappevent_native_test.cpp" ]
36
37  deps = [
38    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
39    "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility",
40    "$native_hiappevent_path/ndk:hiappevent_ndk",
41    "//third_party/googletest:gtest_main",
42  ]
43}
44
45ohos_unittest("HiAppEventCacheTest") {
46  module_out_path = native_module_output_path
47
48  configs = [ ":hiappevent_config_test" ]
49
50  sources = [ "unittest/common/native/hiappevent_cache_test.cpp" ]
51
52  deps = [
53    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
54    "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache",
55    "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility",
56    "$native_hiappevent_path/ndk:hiappevent_ndk",
57    "//third_party/googletest:gtest_main",
58  ]
59
60  external_deps = [ "relational_store:native_rdb" ]
61}
62
63ohos_unittest("HiAppEventWatcherTest") {
64  module_out_path = native_module_output_path
65
66  configs = [ ":hiappevent_config_test" ]
67
68  sources = [ "unittest/common/native/hiappevent_watcher_test.cpp" ]
69
70  deps = [
71    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
72    "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache",
73    "$native_hiappevent_path/libhiappevent/watcher:hiappevent_watcher",
74    "//third_party/googletest:gtest_main",
75  ]
76
77  external_deps = [
78    "eventhandler:libeventhandler",
79    "relational_store:native_rdb",
80  ]
81}
82
83ohos_unittest("HiAppEventReadTest") {
84  module_out_path = native_module_output_path
85
86  configs = [ ":hiappevent_config_test" ]
87
88  sources = [ "unittest/common/native/hiappevent_read_test.cpp" ]
89
90  deps = [
91    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
92    "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility",
93    "//third_party/googletest:gtest_main",
94  ]
95}
96
97group("unittest") {
98  testonly = true
99  deps = [
100    ":HiAppEventCacheTest",
101    ":HiAppEventNativeTest",
102    ":HiAppEventReadTest",
103    ":HiAppEventWatcherTest",
104    "unittest/common/napi:unittest",
105  ]
106}
107