• 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("//build/test.gni")
15
16module_output_path = "hisysevent_native/hisysevent_native"
17
18config("hisysevent_native_test_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [ "include" ]
22}
23
24ohos_moduletest("HiSysEventAdapterNativeTest") {
25  module_out_path = module_output_path
26
27  sources = [ "hisysevent_adapter_native_test.cpp" ]
28
29  configs = [ ":hisysevent_native_test_config" ]
30
31  deps = [
32    "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_impl_client",
33    "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_service_gen_src_client",
34    "//base/hiviewdfx/hisysevent/frameworks/native/util:hisysevent_util",
35    "//third_party/googletest:gtest_main",
36  ]
37
38  if (is_standard_system) {
39    external_deps = [
40      "c_utils:utils",
41      "hisysevent_native:libhisysevent",
42      "hisysevent_native:libhisyseventmanager",
43      "hiviewdfx_hilog_native:libhilog",
44    ]
45  } else {
46    external_deps = [
47      "c_utils:utils",
48      "hilog:libhilog",
49      "hisysevent_native:libhisysevent",
50      "hisysevent_native:libhisyseventmanager",
51    ]
52    cflags_cc = [ "-D__HIVIEW_HAVE_HITRACE__" ]
53  }
54}
55
56ohos_moduletest("HiSysEventNativeTest") {
57  module_out_path = module_output_path
58
59  sources = [ "hisysevent_native_test.cpp" ]
60
61  configs = [ ":hisysevent_native_test_config" ]
62
63  deps = [
64    "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_impl_client",
65    "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_service_gen_src_client",
66    "//third_party/googletest:gtest_main",
67  ]
68
69  if (is_standard_system) {
70    external_deps = [
71      "c_utils:utils",
72      "hisysevent_native:libhisysevent",
73      "hisysevent_native:libhisyseventmanager",
74      "hiviewdfx_hilog_native:libhilog",
75    ]
76  } else {
77    external_deps = [
78      "c_utils:utils",
79      "hilog:libhilog",
80      "hisysevent_native:libhisysevent",
81      "hisysevent_native:libhisyseventmanager",
82    ]
83    cflags_cc = [ "-D__HIVIEW_HAVE_HITRACE__" ]
84  }
85}
86
87ohos_moduletest("HiSysEventCTest") {
88  module_out_path = module_output_path
89
90  sources = [ "hisysevent_c_test.cpp" ]
91
92  configs = [ ":hisysevent_native_test_config" ]
93
94  if (build_public_version) {
95    deps = [ "//third_party/bounds_checking_function:libsec_shared" ]
96  } else {
97    deps = [ "//third_party/bounds_checking_function:libsec_static" ]
98  }
99
100  external_deps = [
101    "hisysevent_native:libhisysevent",
102    "hiviewdfx_hilog_native:libhilog",
103  ]
104}
105
106ohos_moduletest("HiSysEventManagerCTest") {
107  module_out_path = module_output_path
108
109  include_dirs =
110      [ "//base/hiviewdfx/hisysevent/adapter/native/idl/include/ret_code.h" ]
111
112  sources = [ "hisysevent_manager_c_test.cpp" ]
113
114  configs = [ ":hisysevent_native_test_config" ]
115
116  deps = [
117    "//base/hiviewdfx/hisysevent/frameworks/native/util:hisysevent_util",
118    "//third_party/googletest:gtest_main",
119  ]
120
121  if (build_public_version) {
122    deps += [ "//third_party/bounds_checking_function:libsec_shared" ]
123  } else {
124    deps += [ "//third_party/bounds_checking_function:libsec_static" ]
125  }
126
127  external_deps = [
128    "hisysevent_native:libhisyseventmanager",
129    "hiviewdfx_hilog_native:libhilog",
130  ]
131}
132
133group("moduletest") {
134  testonly = true
135  deps = []
136
137  deps += [
138    ":HiSysEventAdapterNativeTest",
139    ":HiSysEventCTest",
140    ":HiSysEventManagerCTest",
141    ":HiSysEventNativeTest",
142  ]
143}
144