• 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.
13import("//base/hiviewdfx/hiview/hiview.gni")
14import("//build/ohos.gni")
15import("//build/test.gni")
16module_output_path = "hiviewdfx/hiview"
17group("moduletest") {
18  testonly = true
19}
20
21ohos_unittest("HiviewPlatformModuleTest") {
22  module_out_path = module_output_path
23
24  include_dirs = [ "moduletest/common" ]
25
26  sources = [ "moduletest/common/hiview_plugin_platform_module_test.cpp" ]
27
28  deps = [
29    "$hiview_base:hiviewbase_static_lib_for_tdd",
30    "//third_party/googletest:gtest_main",
31  ]
32
33  external_deps = [ "hilog:libhilog" ]
34}
35
36config("HolisticPlatformTest_config") {
37  include_dirs = [
38    "../",
39    "$hiview_test/plugins/examples_bundle/bundle_event_source_example",
40    "$hiview_test/plugins/examples/event_source_example",
41  ]
42
43  cflags_cc = [
44    "-D__UNITTEST__",
45    "-D__HIVIEW_OHOS__",
46    "-DUSE_POLL",
47  ]
48}
49
50ohos_unittest("HolisticPlatformTest") {
51  testonly = true
52  module_out_path = module_output_path
53  configs = [ ":HolisticPlatformTest_config" ]
54
55  sources = [ "unittest/common/holistic_platform_test.cpp" ]
56
57  deps = [
58    "$hiview_base:hiviewbase_static_lib_for_tdd",
59    "$hiview_core:hiview_core",
60    "$hiview_root/test/plugins/examples/dynamic_load_plugin_example:dynamicloadpluginexample",
61    "$hiview_root/test/plugins/examples/event_processor_example1:event_processor_example1",
62    "$hiview_root/test/plugins/examples/event_processor_example2:event_processor_example2",
63    "$hiview_root/test/plugins/examples/event_processor_example3:event_processor_example3",
64    "$hiview_root/test/plugins/examples/event_processor_example4:event_processor_example4",
65    "$hiview_root/test/plugins/examples/event_processor_example5:event_processor_example5",
66    "$hiview_root/test/plugins/examples/event_source_example:event_source_example",
67    "$hiview_test/plugins/examples_bundle:bundleplugintest",
68    "//third_party/googletest:gtest_main",
69  ]
70
71  external_deps = [ "hilog:libhilog" ]
72
73  resource_config_file = "$hiview_test/resource/ohos_test.xml"
74}
75
76ohos_unittest("ReportXPowerEventTest") {
77  module_out_path = module_output_path
78  configs = []
79
80  sources = [ "unittest/xpower_event/xpower_event_test.cpp" ]
81
82  deps = [
83    "$hiview_root/interfaces/innerkits/xpower_event:libxpower_event",
84    "//third_party/googletest:gtest_main",
85  ]
86
87  external_deps = [
88    "hilog:libhilog",
89    "init:libbegetutil",
90  ]
91}
92
93if (!defined(ohos_lite)) {
94  import("//build/test.gni")
95  import("//foundation/arkui/ace_engine/ace_config.gni")
96  import("//foundation/arkui/napi/napi.gni")
97  import("//foundation/arkui/napi/test/unittest/ut.gni")
98
99  ohos_unittest("ReportXPowerJsEventTest") {
100    module_out_path = module_output_path
101    cflags = [ "-g3" ]
102    defines = [ "NAPI_TEST" ]
103    include_dirs = ark_include
104    include_dirs += [
105      "//foundation/arkui/napi/test/unittest/engine/",
106      "//foundation/arkui/napi/test/unittest/common/",
107    ]
108
109    sources = [
110      "//foundation/arkui/napi/test/unittest/engine/test_ark.cpp",
111      "unittest/xpower_event/xpower_jsevent_test.cpp",
112    ]
113
114    deps = ark_deps
115    deps +=
116        [ "$hiview_root/interfaces/innerkits/xpower_event:libxpower_event_js" ]
117
118    external_deps = [
119      "bounds_checking_function:libsec_shared",
120      "c_utils:utils",
121      "ets_runtime:libark_jsruntime",
122      "init:libbegetutil",
123      "napi:ace_napi",
124    ]
125
126    external_deps += [ "hilog:libhilog" ]
127  }
128}
129
130group("unittest") {
131  testonly = true
132  deps = [
133    ":HiviewPlatformModuleTest",
134    ":HolisticPlatformTest",
135    ":ReportXPowerEventTest",
136    ":ReportXPowerJsEventTest",
137    "unittest/unified_collection/client:UCollectionClientUnitTest",
138    "unittest/unified_collection/utility:UCollectionUtilityUnitTest",
139  ]
140}
141