# Copyright (c) 2021-2022 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("//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/watcher/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 = [ "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/watcher:hiappevent_watcher", "//third_party/googletest:gtest_main", ] external_deps = [ "eventhandler:libeventhandler", "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", ] } group("unittest") { testonly = true deps = [ ":HiAppEventCacheTest", ":HiAppEventNativeTest", ":HiAppEventReadTest", ":HiAppEventWatcherTest", "unittest/common/napi:unittest", ] }