# Copyright (c) 2021 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") module_output_path = "hisysevent_native/hisysevent_native" config("hisysevent_native_test_config") { visibility = [ ":*" ] include_dirs = [ "include" ] } ohos_moduletest("HiSysEventAdapterNativeTest") { module_out_path = module_output_path sources = [ "hisysevent_adapter_native_test.cpp" ] configs = [ ":hisysevent_native_test_config" ] deps = [ "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_impl_client", "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_service_gen_src_client", "//base/hiviewdfx/hisysevent/frameworks/native/util:hisysevent_util", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "hisysevent_native:libhisysevent", "hisysevent_native:libhisyseventmanager", "hiviewdfx_hilog_native:libhilog", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", "hisysevent_native:libhisysevent", "hisysevent_native:libhisyseventmanager", ] cflags_cc = [ "-D__HIVIEW_HAVE_HITRACE__" ] } } ohos_moduletest("HiSysEventNativeTest") { module_out_path = module_output_path sources = [ "hisysevent_native_test.cpp" ] configs = [ ":hisysevent_native_test_config" ] deps = [ "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_impl_client", "//base/hiviewdfx/hisysevent/adapter/native/idl:sys_event_service_gen_src_client", "//third_party/googletest:gtest_main", ] if (is_standard_system) { external_deps = [ "c_utils:utils", "hisysevent_native:libhisysevent", "hisysevent_native:libhisyseventmanager", "hiviewdfx_hilog_native:libhilog", ] } else { external_deps = [ "c_utils:utils", "hilog:libhilog", "hisysevent_native:libhisysevent", "hisysevent_native:libhisyseventmanager", ] cflags_cc = [ "-D__HIVIEW_HAVE_HITRACE__" ] } } ohos_moduletest("HiSysEventCTest") { module_out_path = module_output_path sources = [ "hisysevent_c_test.cpp" ] configs = [ ":hisysevent_native_test_config" ] if (build_public_version) { deps = [ "//third_party/bounds_checking_function:libsec_shared" ] } else { deps = [ "//third_party/bounds_checking_function:libsec_static" ] } external_deps = [ "hisysevent_native:libhisysevent", "hiviewdfx_hilog_native:libhilog", ] } ohos_moduletest("HiSysEventManagerCTest") { module_out_path = module_output_path include_dirs = [ "//base/hiviewdfx/hisysevent/adapter/native/idl/include/ret_code.h" ] sources = [ "hisysevent_manager_c_test.cpp" ] configs = [ ":hisysevent_native_test_config" ] deps = [ "//base/hiviewdfx/hisysevent/frameworks/native/util:hisysevent_util", "//third_party/googletest:gtest_main", ] if (build_public_version) { deps += [ "//third_party/bounds_checking_function:libsec_shared" ] } else { deps += [ "//third_party/bounds_checking_function:libsec_static" ] } external_deps = [ "hisysevent_native:libhisyseventmanager", "hiviewdfx_hilog_native:libhilog", ] } group("moduletest") { testonly = true deps = [] deps += [ ":HiSysEventAdapterNativeTest", ":HiSysEventCTest", ":HiSysEventManagerCTest", ":HiSysEventNativeTest", ] }