# Copyright (c) 2023-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/hiview/hiview.gni") import("//build/test.gni") config("ucollection_utility_test_config") { visibility = [ ":*" ] include_dirs = [ ".", "$hiview_framework/native/unified_collection/collector/inner_include", "$hiview_base/utility/include", ] cflags = [ "-D__UNITTEST__" ] if (has_hiperf) { cflags += [ "-DHAS_HIPERF" ] } } ohos_unittest("UCollectionUtilityUnitTest") { module_out_path = "hiviewdfx/hiview" configs = [ ":ucollection_utility_test_config" ] sources = [ "$hiview_framework/native/unified_collection/collector/utils/trace_manager.cpp", "$hiview_framework/native/unified_collection/collector/utils/trace_utils.cpp", "cpu_collector_test.cpp", "gpu_collector_test.cpp", "graphic_memory_collector_test.cpp", "hiebpf_collector_test.cpp", "hilog_collector_test.cpp", "io_collector_test.cpp", "memory_collector_test.cpp", "network_collector_test.cpp", "perf_collector_test.cpp", "trace_collector_test.cpp", "wm_collector_test.cpp", ] if (has_hiprofiler) { sources += [ "mem_profiler_collector_test.cpp" ] } cflags_cc = [] deps = [ "$hiview_base/event_report:hiview_event_report", "$hiview_base/utility:hiview_utility", "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_graphic", "$hiview_interfaces/inner_api/unified_collection/utility:libucollection_utility", ] external_deps = [ "access_token:libaccesstoken_sdk", "access_token:libnativetoken", "access_token:libtoken_setproc", "ffrt:libffrt", "googletest:gtest_main", "hilog:libhilog", "hitrace:hitrace_dump", "init:libbegetutil", "zlib:libz", ] if (has_hiprofiler) { external_deps += [ "hiprofiler:libnative_daemon_client" ] } if (has_hiperf) { cflags = [ "-DHAS_HIPERF" ] } defines = [] if (is_wifi_enable) { external_deps += [ "wifi:wifi_sdk" ] defines += [ "COMMUNICATION_WIFI_ENABLE" ] } }