# Copyright (c) 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/ohos.gni") import("//build/test.gni") module_output_path = "hiview/hiview/leak_detector" config("leak_detector_test_config") { visibility = [ ":*" ] include_dirs = [ ".", "..", "../base", "../native_leak", "$hiview_base/event_raw/include", "$hiview_base/event_publish/include", "$hiview_base/include", "$hiview_base/logstore/include", "$hiview_base/utility/include", "$hiview_root/include", "$hiview_root/interfaces/inner_api/unified_collection", "$hiview_root/interfaces/inner_api/unified_collection/utility", "$hiview_plugin/faultlogger/common", "$hiview_plugin/faultlogger/service", ] } ohos_unittest("LeakDetectorUnitTest") { module_out_path = module_output_path if (hiview_enable_leak_detector) { part_name = "hiview" subsystem_name = "hiviewdfx" sources = [ "../native_leak/native_leak_config.cpp", "test_util.cpp", "unittest/leak_detector_unit_test.cpp", ] configs = [ ":leak_detector_test_config" ] cflags = [ "-DUNITTEST" ] external_deps = [ "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hiprofiler:libnative_daemon_client", "hisysevent:libhisysevent", "init:libbegetutil", ] if (has_hiprofiler) { cflags += [ "-DHAS_HIPROFILER" ] } } } ohos_moduletest("LeakDetectorModuleTest") { module_out_path = module_output_path if (hiview_enable_leak_detector) { part_name = "hiview" subsystem_name = "hiviewdfx" sources = [ "moduletest/leak_detector_module_test.cpp", "test_util.cpp", ] configs = [ ":leak_detector_test_config" ] cflags = [ "-DMOUDLETEST" ] external_deps = [ "bundle_framework:appexecfwk_base", "bundle_framework:appexecfwk_core", "c_utils:utils", "ffrt:libffrt", "hilog:libhilog", "hiprofiler:libnative_daemon_client", "hisysevent:libhisysevent", "init:libbegetutil", ] if (has_hiprofiler) { cflags += [ "-DHAS_HIPROFILER" ] } } }