# 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("//base/hiviewdfx/hiview/hiview.gni") import("//build/ohos.gni") import("//build/test.gni") module_output_path = "hiviewdfx/hiview" group("moduletest") { testonly = true } ohos_unittest("HiviewPlatformModuleTest") { module_out_path = module_output_path include_dirs = [ "moduletest/common" ] sources = [ "moduletest/common/hiview_plugin_platform_module_test.cpp" ] deps = [ "$hiview_base:hiviewbase_static_lib_for_tdd" ] external_deps = [ "googletest:gtest_main", "hilog:libhilog", ] } config("HolisticPlatformTest_config") { include_dirs = [ "../", "$hiview_test/plugins/examples_bundle/bundle_event_source_example", "$hiview_test/plugins/examples/event_source_example", ] cflags_cc = [ "-D__UNITTEST__", "-D__HIVIEW_OHOS__", "-DUSE_POLL", ] } ohos_unittest("HolisticPlatformTest") { testonly = true module_out_path = module_output_path configs = [ ":HolisticPlatformTest_config" ] sources = [ "unittest/common/holistic_platform_test.cpp" ] deps = [ "$hiview_base:hiviewbase_static_lib_for_tdd", "$hiview_core:hiview_core_for_test", "$hiview_root/test/plugins/examples/dynamic_load_plugin_example:dynamicloadpluginexample", "$hiview_root/test/plugins/examples/event_processor_example1:event_processor_example1", "$hiview_root/test/plugins/examples/event_processor_example2:event_processor_example2", "$hiview_root/test/plugins/examples/event_processor_example3:event_processor_example3", "$hiview_root/test/plugins/examples/event_processor_example4:event_processor_example4", "$hiview_root/test/plugins/examples/event_processor_example5:event_processor_example5", "$hiview_root/test/plugins/examples/event_source_example:event_source_example", "$hiview_test/plugins/examples_bundle:bundleplugintest", ] external_deps = [ "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", ] resource_config_file = "$hiview_test/resource/ohos_test.xml" } ohos_unittest("ReportXPowerEventTest") { module_out_path = module_output_path configs = [] sources = [ "unittest/xpower_event/xpower_event_test.cpp" ] deps = [ "$hiview_root/interfaces/innerkits/xpower_event:libxpower_event" ] external_deps = [ "googletest:gtest_main", "hilog:libhilog", "init:libbegetutil", ] } if (!defined(ohos_lite)) { import("//build/test.gni") ohos_unittest("ReportXPowerJsEventTest") { module_out_path = module_output_path cflags = [ "-g3" ] defines = [ "NAPI_TEST" ] include_dirs = [ "//foundation/arkui/napi/test/unittest/engine/", "//foundation/arkui/napi/test/unittest/common/", ] sources = [ "unittest/xpower_event/xpower_jsevent_test.cpp" ] deps = [ "$hiview_root/interfaces/innerkits/xpower_event:libxpower_event_js" ] external_deps = [ "bounds_checking_function:libsec_shared", "c_utils:utils", "ets_runtime:libark_jsruntime", "init:libbegetutil", "napi:ace_napi", ] external_deps += [ "hilog:libhilog" ] } } group("unittest") { testonly = true deps = [ ":HiviewPlatformModuleTest", ":HolisticPlatformTest", ":ReportXPowerEventTest", ":ReportXPowerJsEventTest", "unittest/unified_collection/client:UCollectionClientUnitTest", "unittest/unified_collection/utility:UCollectionUtilityUnitTest", ] }