11401458bSopenharmony_ci# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
21401458bSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
31401458bSopenharmony_ci# you may not use this file except in compliance with the License.
41401458bSopenharmony_ci# You may obtain a copy of the License at
51401458bSopenharmony_ci#
61401458bSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
71401458bSopenharmony_ci#
81401458bSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
91401458bSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
101401458bSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
111401458bSopenharmony_ci# See the License for the specific language governing permissions and
121401458bSopenharmony_ci# limitations under the License.
131401458bSopenharmony_ci
141401458bSopenharmony_ciimport("//build/test.gni")
151401458bSopenharmony_ci
161401458bSopenharmony_cimodule_output_path = "hisysevent/hisysevent_native"
171401458bSopenharmony_ci
181401458bSopenharmony_ciconfig("hisysevent_native_test_config") {
191401458bSopenharmony_ci  visibility = [ ":*" ]
201401458bSopenharmony_ci
211401458bSopenharmony_ci  include_dirs = [ "include" ]
221401458bSopenharmony_ci}
231401458bSopenharmony_ci
241401458bSopenharmony_cideclare_args() {
251401458bSopenharmony_ci  hiviewdfx_hitrace_enabaled_for_test = false
261401458bSopenharmony_ci  if (defined(global_parts_info) &&
271401458bSopenharmony_ci      defined(global_parts_info.hiviewdfx_hitrace)) {
281401458bSopenharmony_ci    hiviewdfx_hitrace_enabaled_for_test = true
291401458bSopenharmony_ci  }
301401458bSopenharmony_ci}
311401458bSopenharmony_ci
321401458bSopenharmony_ciohos_moduletest("HiSysEventAdapterNativeTest") {
331401458bSopenharmony_ci  module_out_path = module_output_path
341401458bSopenharmony_ci
351401458bSopenharmony_ci  sources = [ "hisysevent_adapter_native_test.cpp" ]
361401458bSopenharmony_ci
371401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
381401458bSopenharmony_ci
391401458bSopenharmony_ci  deps = [
401401458bSopenharmony_ci    "../../../adapter/native/idl:sys_event_impl_client",
411401458bSopenharmony_ci    "../../../adapter/native/idl:sys_event_service_gen_src_client",
421401458bSopenharmony_ci    "../../../frameworks/native/util:hisysevent_util",
431401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd",
441401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent_manager:hisyseventmanager_static_lib_for_tdd",
451401458bSopenharmony_ci  ]
461401458bSopenharmony_ci
471401458bSopenharmony_ci  if (is_standard_system) {
481401458bSopenharmony_ci    external_deps = [
491401458bSopenharmony_ci      "c_utils:utils",
501401458bSopenharmony_ci      "hilog:libhilog",
511401458bSopenharmony_ci      "ipc:ipc_single",
521401458bSopenharmony_ci      "samgr:samgr_proxy",
531401458bSopenharmony_ci    ]
541401458bSopenharmony_ci  } else {
551401458bSopenharmony_ci    external_deps = [
561401458bSopenharmony_ci      "c_utils:utils",
571401458bSopenharmony_ci      "hilog:libhilog",
581401458bSopenharmony_ci      "ipc:ipc_single",
591401458bSopenharmony_ci      "samgr:samgr_proxy",
601401458bSopenharmony_ci    ]
611401458bSopenharmony_ci    cflags_cc = [ "-D__HIVIEW_HAVE_HITRACE__" ]
621401458bSopenharmony_ci  }
631401458bSopenharmony_ci}
641401458bSopenharmony_ci
651401458bSopenharmony_ciohos_moduletest("HiSysEventNativeTest") {
661401458bSopenharmony_ci  module_out_path = module_output_path
671401458bSopenharmony_ci
681401458bSopenharmony_ci  sources = [ "hisysevent_native_test.cpp" ]
691401458bSopenharmony_ci
701401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
711401458bSopenharmony_ci
721401458bSopenharmony_ci  deps = [
731401458bSopenharmony_ci    "../../../adapter/native/idl:sys_event_impl_client",
741401458bSopenharmony_ci    "../../../adapter/native/idl:sys_event_service_gen_src_client",
751401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd",
761401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent_manager:hisyseventmanager_static_lib_for_tdd",
771401458bSopenharmony_ci  ]
781401458bSopenharmony_ci
791401458bSopenharmony_ci  if (is_standard_system) {
801401458bSopenharmony_ci    external_deps = [
811401458bSopenharmony_ci      "c_utils:utils",
821401458bSopenharmony_ci      "hilog:libhilog",
831401458bSopenharmony_ci    ]
841401458bSopenharmony_ci  } else {
851401458bSopenharmony_ci    external_deps = [
861401458bSopenharmony_ci      "c_utils:utils",
871401458bSopenharmony_ci      "hilog:libhilog",
881401458bSopenharmony_ci    ]
891401458bSopenharmony_ci    cflags_cc = [ "-D__HIVIEW_HAVE_HITRACE__" ]
901401458bSopenharmony_ci  }
911401458bSopenharmony_ci}
921401458bSopenharmony_ci
931401458bSopenharmony_ciohos_moduletest("HiSysEventCTest") {
941401458bSopenharmony_ci  module_out_path = module_output_path
951401458bSopenharmony_ci
961401458bSopenharmony_ci  sources = [ "hisysevent_c_test.cpp" ]
971401458bSopenharmony_ci
981401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
991401458bSopenharmony_ci
1001401458bSopenharmony_ci  external_deps = [
1011401458bSopenharmony_ci    "hilog:libhilog",
1021401458bSopenharmony_ci    "hisysevent:libhisysevent",
1031401458bSopenharmony_ci  ]
1041401458bSopenharmony_ci
1051401458bSopenharmony_ci  if (build_public_version) {
1061401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_shared" ]
1071401458bSopenharmony_ci  } else {
1081401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_static" ]
1091401458bSopenharmony_ci  }
1101401458bSopenharmony_ci}
1111401458bSopenharmony_ci
1121401458bSopenharmony_ciohos_moduletest("HiSysEventManagerCTest") {
1131401458bSopenharmony_ci  module_out_path = module_output_path
1141401458bSopenharmony_ci
1151401458bSopenharmony_ci  include_dirs =
1161401458bSopenharmony_ci      [ "//base/hiviewdfx/hisysevent/adapter/native/idl/include/ret_code.h" ]
1171401458bSopenharmony_ci
1181401458bSopenharmony_ci  sources = [ "hisysevent_manager_c_test.cpp" ]
1191401458bSopenharmony_ci
1201401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
1211401458bSopenharmony_ci
1221401458bSopenharmony_ci  deps = [
1231401458bSopenharmony_ci    "../../../frameworks/native/util:hisysevent_util",
1241401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent_manager:hisyseventmanager_static_lib_for_tdd",
1251401458bSopenharmony_ci  ]
1261401458bSopenharmony_ci
1271401458bSopenharmony_ci  external_deps = [ "hilog:libhilog" ]
1281401458bSopenharmony_ci
1291401458bSopenharmony_ci  if (build_public_version) {
1301401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_shared" ]
1311401458bSopenharmony_ci  } else {
1321401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_static" ]
1331401458bSopenharmony_ci  }
1341401458bSopenharmony_ci}
1351401458bSopenharmony_ci
1361401458bSopenharmony_ciohos_moduletest("HiSysEventDelayTest") {
1371401458bSopenharmony_ci  module_out_path = module_output_path
1381401458bSopenharmony_ci
1391401458bSopenharmony_ci  include_dirs =
1401401458bSopenharmony_ci      [ "//base/hiviewdfx/hisysevent/adapter/native/idl/include/ret_code.h" ]
1411401458bSopenharmony_ci
1421401458bSopenharmony_ci  sources = [ "hisysevent_delay_test.cpp" ]
1431401458bSopenharmony_ci
1441401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
1451401458bSopenharmony_ci
1461401458bSopenharmony_ci  deps = [
1471401458bSopenharmony_ci    "../../../frameworks/native/util:hisysevent_util",
1481401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd",
1491401458bSopenharmony_ci  ]
1501401458bSopenharmony_ci
1511401458bSopenharmony_ci  external_deps = [ "hilog:libhilog" ]
1521401458bSopenharmony_ci
1531401458bSopenharmony_ci  if (build_public_version) {
1541401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_shared" ]
1551401458bSopenharmony_ci  } else {
1561401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_static" ]
1571401458bSopenharmony_ci  }
1581401458bSopenharmony_ci}
1591401458bSopenharmony_ci
1601401458bSopenharmony_ciohos_moduletest("HiSysEventWroteResultCheckTest") {
1611401458bSopenharmony_ci  module_out_path = module_output_path
1621401458bSopenharmony_ci
1631401458bSopenharmony_ci  include_dirs =
1641401458bSopenharmony_ci      [ "//base/hiviewdfx/hisysevent/adapter/native/idl/include/ret_code.h" ]
1651401458bSopenharmony_ci
1661401458bSopenharmony_ci  sources = [ "hisysevent_wrote_result_check_test.cpp" ]
1671401458bSopenharmony_ci
1681401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
1691401458bSopenharmony_ci
1701401458bSopenharmony_ci  deps = [
1711401458bSopenharmony_ci    "../../../frameworks/native/util:hisysevent_util",
1721401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd",
1731401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent_manager:hisyseventmanager_static_lib_for_tdd",
1741401458bSopenharmony_ci  ]
1751401458bSopenharmony_ci
1761401458bSopenharmony_ci  external_deps = [ "hilog:libhilog" ]
1771401458bSopenharmony_ci
1781401458bSopenharmony_ci  defines = []
1791401458bSopenharmony_ci  if (hiviewdfx_hitrace_enabaled_for_test) {
1801401458bSopenharmony_ci    external_deps += [ "hitrace:libhitracechain" ]
1811401458bSopenharmony_ci    defines += [ "HIVIEWDFX_HITRACE_ENABLED_FOR_TEST" ]
1821401458bSopenharmony_ci  }
1831401458bSopenharmony_ci
1841401458bSopenharmony_ci  if (build_public_version) {
1851401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_shared" ]
1861401458bSopenharmony_ci  } else {
1871401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_static" ]
1881401458bSopenharmony_ci  }
1891401458bSopenharmony_ci}
1901401458bSopenharmony_ci
1911401458bSopenharmony_ciohos_moduletest("HiSysEventEncodedTest") {
1921401458bSopenharmony_ci  module_out_path = module_output_path
1931401458bSopenharmony_ci
1941401458bSopenharmony_ci  include_dirs =
1951401458bSopenharmony_ci      [ "//base/hiviewdfx/hisysevent/adapter/native/idl/include/ret_code.h" ]
1961401458bSopenharmony_ci
1971401458bSopenharmony_ci  sources = [ "hisysevent_encoded_test.cpp" ]
1981401458bSopenharmony_ci
1991401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
2001401458bSopenharmony_ci
2011401458bSopenharmony_ci  deps = [
2021401458bSopenharmony_ci    "../../../frameworks/native/util:hisysevent_util",
2031401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent:hisysevent_static_lib_for_tdd",
2041401458bSopenharmony_ci  ]
2051401458bSopenharmony_ci
2061401458bSopenharmony_ci  external_deps = [ "hilog:libhilog" ]
2071401458bSopenharmony_ci
2081401458bSopenharmony_ci  if (build_public_version) {
2091401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_shared" ]
2101401458bSopenharmony_ci  } else {
2111401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_static" ]
2121401458bSopenharmony_ci  }
2131401458bSopenharmony_ci}
2141401458bSopenharmony_ci
2151401458bSopenharmony_ciohos_moduletest("HiSysEventEasyTest") {
2161401458bSopenharmony_ci  module_out_path = module_output_path
2171401458bSopenharmony_ci
2181401458bSopenharmony_ci  sources = [ "hisysevent_easy_test.cpp" ]
2191401458bSopenharmony_ci
2201401458bSopenharmony_ci  configs = [ ":hisysevent_native_test_config" ]
2211401458bSopenharmony_ci
2221401458bSopenharmony_ci  deps = [
2231401458bSopenharmony_ci    "../../../interfaces/native/innerkits/hisysevent_easy:libhisysevent_easy",
2241401458bSopenharmony_ci  ]
2251401458bSopenharmony_ci
2261401458bSopenharmony_ci  external_deps = [ "hilog:libhilog" ]
2271401458bSopenharmony_ci
2281401458bSopenharmony_ci  if (build_public_version) {
2291401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_shared" ]
2301401458bSopenharmony_ci  } else {
2311401458bSopenharmony_ci    external_deps += [ "bounds_checking_function:libsec_static" ]
2321401458bSopenharmony_ci  }
2331401458bSopenharmony_ci}
2341401458bSopenharmony_ci
2351401458bSopenharmony_cigroup("moduletest") {
2361401458bSopenharmony_ci  testonly = true
2371401458bSopenharmony_ci  deps = []
2381401458bSopenharmony_ci
2391401458bSopenharmony_ci  deps += [
2401401458bSopenharmony_ci    ":HiSysEventAdapterNativeTest",
2411401458bSopenharmony_ci    ":HiSysEventCTest",
2421401458bSopenharmony_ci    ":HiSysEventDelayTest",
2431401458bSopenharmony_ci    ":HiSysEventEasyTest",
2441401458bSopenharmony_ci    ":HiSysEventEncodedTest",
2451401458bSopenharmony_ci    ":HiSysEventManagerCTest",
2461401458bSopenharmony_ci    ":HiSysEventNativeTest",
2471401458bSopenharmony_ci    ":HiSysEventWroteResultCheckTest",
2481401458bSopenharmony_ci  ]
2491401458bSopenharmony_ci}
250