# Copyright (c) 2021-2024 Huawei Device Co., Ltd. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. import("//base/hiviewdfx/hiappevent/hiappevent.gni") import("//build/test.gni") native_hiappevent_path = "//base/hiviewdfx/hiappevent/frameworks/native" native_module_output_path = "hiappevent/native" config("hiappevent_config_test") { visibility = [ ":*" ] include_dirs = [ ".", "//base/hiviewdfx/hiappevent/interfaces/native/kits/include", "$native_hiappevent_path/libhiappevent/include", "$native_hiappevent_path/libhiappevent/observer/include", "$native_hiappevent_path/ndk/include", "$hiappevent_interfaces/native/kits/include", ] } ohos_unittest("HiAppEventNativeTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_native_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility", "$native_hiappevent_path/ndk:hiappevent_ndk", "//third_party/googletest:gtest_main", ] } ohos_unittest("HiAppEventCacheTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_cache_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache", "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility", "$native_hiappevent_path/ndk:hiappevent_ndk", "//third_party/googletest:gtest_main", ] external_deps = [ "ffrt:libffrt", "hilog:libhilog", "relational_store:native_rdb", ] } ohos_unittest("HiAppEventWatcherTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_watcher_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache", "$native_hiappevent_path/libhiappevent/observer:hiappevent_observer", "//third_party/googletest:gtest_main", ] external_deps = [ "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "relational_store:native_rdb", ] } ohos_unittest("HiAppEventReadTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_read_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "$native_hiappevent_path/libhiappevent/utility:hiappevent_utility", "//third_party/googletest:gtest_main", ] } ohos_unittest("HiAppEventInnerApiTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_inner_api_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "processor:test_processor", "//third_party/googletest:gtest_main", ] resource_config_file = "resource/ohos_test.xml" external_deps = [ "ffrt:libffrt", "hiappevent:hiappevent_innerapi", ] } ohos_unittest("HiAppEventUserInfoTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_userinfo_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "$native_hiappevent_path/libhiappevent/cache:hiappevent_cache", "//third_party/googletest:gtest_main", ] external_deps = [ "eventhandler:libeventhandler", "ffrt:libffrt", "hilog:libhilog", "relational_store:native_rdb", ] } ohos_unittest("HiAppEventAppEventTest") { module_out_path = native_module_output_path configs = [ ":hiappevent_config_test" ] sources = [ "unittest/common/native/hiappevent_app_event_test.cpp" ] deps = [ "$native_hiappevent_path/libhiappevent:libhiappevent_base", "//third_party/googletest:gtest_main", ] external_deps = [ "hiappevent:hiappevent_innerapi" ] } group("unittest") { testonly = true deps = [ ":HiAppEventAppEventTest", ":HiAppEventCacheTest", ":HiAppEventInnerApiTest", ":HiAppEventNativeTest", ":HiAppEventReadTest", ":HiAppEventUserInfoTest", ":HiAppEventWatcherTest", "unittest/common/napi:unittest", ] }