17405867cSopenharmony_ci# Copyright (c) 2021-2024 Huawei Device Co., Ltd.
27405867cSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
37405867cSopenharmony_ci# you may not use this file except in compliance with the License.
47405867cSopenharmony_ci# You may obtain a copy of the License at
57405867cSopenharmony_ci#
67405867cSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
77405867cSopenharmony_ci#
87405867cSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
97405867cSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
107405867cSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
117405867cSopenharmony_ci# See the License for the specific language governing permissions and
127405867cSopenharmony_ci# limitations under the License.
137405867cSopenharmony_ci
147405867cSopenharmony_ciimport("//base/hiviewdfx/hiappevent/hiappevent.gni")
157405867cSopenharmony_ciimport("//build/test.gni")
167405867cSopenharmony_ci
177405867cSopenharmony_cinative_hiappevent_path = "//base/hiviewdfx/hiappevent/frameworks/native"
187405867cSopenharmony_cinative_module_output_path = "hiappevent/native"
197405867cSopenharmony_ci
207405867cSopenharmony_ciconfig("hiappevent_config_test") {
217405867cSopenharmony_ci  visibility = [ ":*" ]
227405867cSopenharmony_ci
237405867cSopenharmony_ci  include_dirs = [
247405867cSopenharmony_ci    ".",
257405867cSopenharmony_ci    "//base/hiviewdfx/hiappevent/interfaces/native/kits/include",
267405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/include",
277405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/observer/include",
287405867cSopenharmony_ci    "$native_hiappevent_path/ndk/include",
297405867cSopenharmony_ci    "$hiappevent_interfaces/native/kits/include",
307405867cSopenharmony_ci  ]
317405867cSopenharmony_ci}
327405867cSopenharmony_ci
337405867cSopenharmony_ciohos_unittest("HiAppEventNativeTest") {
347405867cSopenharmony_ci  module_out_path = native_module_output_path
357405867cSopenharmony_ci
367405867cSopenharmony_ci  configs = [ ":hiappevent_config_test" ]
377405867cSopenharmony_ci
387405867cSopenharmony_ci  sources = [ "unittest/common/native/hiappevent_native_test.cpp" ]
397405867cSopenharmony_ci
407405867cSopenharmony_ci  deps = [
417405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
427405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility",
437405867cSopenharmony_ci    "$native_hiappevent_path/ndk:hiappevent_ndk",
447405867cSopenharmony_ci    "//third_party/googletest:gtest_main",
457405867cSopenharmony_ci  ]
467405867cSopenharmony_ci}
477405867cSopenharmony_ci
487405867cSopenharmony_ciohos_unittest("HiAppEventCacheTest") {
497405867cSopenharmony_ci  module_out_path = native_module_output_path
507405867cSopenharmony_ci
517405867cSopenharmony_ci  configs = [ ":hiappevent_config_test" ]
527405867cSopenharmony_ci
537405867cSopenharmony_ci  sources = [ "unittest/common/native/hiappevent_cache_test.cpp" ]
547405867cSopenharmony_ci
557405867cSopenharmony_ci  deps = [
567405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
577405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache",
587405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility",
597405867cSopenharmony_ci    "$native_hiappevent_path/ndk:hiappevent_ndk",
607405867cSopenharmony_ci    "//third_party/googletest:gtest_main",
617405867cSopenharmony_ci  ]
627405867cSopenharmony_ci
637405867cSopenharmony_ci  external_deps = [
647405867cSopenharmony_ci    "ffrt:libffrt",
657405867cSopenharmony_ci    "hilog:libhilog",
667405867cSopenharmony_ci    "relational_store:native_rdb",
677405867cSopenharmony_ci  ]
687405867cSopenharmony_ci}
697405867cSopenharmony_ci
707405867cSopenharmony_ciohos_unittest("HiAppEventWatcherTest") {
717405867cSopenharmony_ci  module_out_path = native_module_output_path
727405867cSopenharmony_ci
737405867cSopenharmony_ci  configs = [ ":hiappevent_config_test" ]
747405867cSopenharmony_ci
757405867cSopenharmony_ci  sources = [ "unittest/common/native/hiappevent_watcher_test.cpp" ]
767405867cSopenharmony_ci
777405867cSopenharmony_ci  deps = [
787405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
797405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache",
807405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/observer:hiappevent_observer",
817405867cSopenharmony_ci    "//third_party/googletest:gtest_main",
827405867cSopenharmony_ci  ]
837405867cSopenharmony_ci
847405867cSopenharmony_ci  external_deps = [
857405867cSopenharmony_ci    "eventhandler:libeventhandler",
867405867cSopenharmony_ci    "ffrt:libffrt",
877405867cSopenharmony_ci    "hilog:libhilog",
887405867cSopenharmony_ci    "relational_store:native_rdb",
897405867cSopenharmony_ci  ]
907405867cSopenharmony_ci}
917405867cSopenharmony_ci
927405867cSopenharmony_ciohos_unittest("HiAppEventInnerApiTest") {
937405867cSopenharmony_ci  module_out_path = native_module_output_path
947405867cSopenharmony_ci
957405867cSopenharmony_ci  configs = [ ":hiappevent_config_test" ]
967405867cSopenharmony_ci
977405867cSopenharmony_ci  sources = [ "unittest/common/native/hiappevent_inner_api_test.cpp" ]
987405867cSopenharmony_ci
997405867cSopenharmony_ci  deps = [
1007405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
1017405867cSopenharmony_ci    "processor:test_processor",
1027405867cSopenharmony_ci    "//third_party/googletest:gtest_main",
1037405867cSopenharmony_ci  ]
1047405867cSopenharmony_ci
1057405867cSopenharmony_ci  resource_config_file = "resource/ohos_test.xml"
1067405867cSopenharmony_ci
1077405867cSopenharmony_ci  external_deps = [
1087405867cSopenharmony_ci    "ffrt:libffrt",
1097405867cSopenharmony_ci    "hiappevent:hiappevent_innerapi",
1107405867cSopenharmony_ci  ]
1117405867cSopenharmony_ci}
1127405867cSopenharmony_ci
1137405867cSopenharmony_ciohos_unittest("HiAppEventUserInfoTest") {
1147405867cSopenharmony_ci  module_out_path = native_module_output_path
1157405867cSopenharmony_ci
1167405867cSopenharmony_ci  configs = [ ":hiappevent_config_test" ]
1177405867cSopenharmony_ci
1187405867cSopenharmony_ci  sources = [ "unittest/common/native/hiappevent_userinfo_test.cpp" ]
1197405867cSopenharmony_ci
1207405867cSopenharmony_ci  deps = [
1217405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
1227405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache",
1237405867cSopenharmony_ci    "//third_party/googletest:gtest_main",
1247405867cSopenharmony_ci  ]
1257405867cSopenharmony_ci
1267405867cSopenharmony_ci  external_deps = [
1277405867cSopenharmony_ci    "eventhandler:libeventhandler",
1287405867cSopenharmony_ci    "ffrt:libffrt",
1297405867cSopenharmony_ci    "hilog:libhilog",
1307405867cSopenharmony_ci    "relational_store:native_rdb",
1317405867cSopenharmony_ci  ]
1327405867cSopenharmony_ci}
1337405867cSopenharmony_ci
1347405867cSopenharmony_ciohos_unittest("HiAppEventAppEventTest") {
1357405867cSopenharmony_ci  module_out_path = native_module_output_path
1367405867cSopenharmony_ci
1377405867cSopenharmony_ci  configs = [ ":hiappevent_config_test" ]
1387405867cSopenharmony_ci
1397405867cSopenharmony_ci  sources = [ "unittest/common/native/hiappevent_app_event_test.cpp" ]
1407405867cSopenharmony_ci
1417405867cSopenharmony_ci  deps = [
1427405867cSopenharmony_ci    "$native_hiappevent_path/libhiappevent:libhiappevent_base",
1437405867cSopenharmony_ci    "//third_party/googletest:gtest_main",
1447405867cSopenharmony_ci  ]
1457405867cSopenharmony_ci
1467405867cSopenharmony_ci  external_deps = [ "hiappevent:hiappevent_innerapi" ]
1477405867cSopenharmony_ci}
1487405867cSopenharmony_ci
1497405867cSopenharmony_cigroup("unittest") {
1507405867cSopenharmony_ci  testonly = true
1517405867cSopenharmony_ci  deps = [
1527405867cSopenharmony_ci    ":HiAppEventAppEventTest",
1537405867cSopenharmony_ci    ":HiAppEventCacheTest",
1547405867cSopenharmony_ci    ":HiAppEventInnerApiTest",
1557405867cSopenharmony_ci    ":HiAppEventNativeTest",
1567405867cSopenharmony_ci    ":HiAppEventUserInfoTest",
1577405867cSopenharmony_ci    ":HiAppEventWatcherTest",
1587405867cSopenharmony_ci    "unittest/common/napi:unittest",
1597405867cSopenharmony_ci  ]
1607405867cSopenharmony_ci}
161