1# Copyright (c) 2025 Huawei Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13import("//base/hiviewdfx/hiview/hiview.gni") 14import("//build/test.gni") 15 16config("trace_manager_test_config") { 17 visibility = [ ":*" ] 18 19 include_dirs = [ 20 ".", 21 "$hiview_base/include", 22 "$hiview_base/utility/include", 23 "$hiview_base/event_raw/include", 24 "$hiview_base/utility/include", 25 "$hiview_framework/native/unified_collection/trace_manager/include", 26 "$hiview_framework/native/unified_collection/trace_manager/state/include", 27 "$hiview_framework/native/unified_collection/trace_manager/storage/include", 28 "$hiview_framework/native/unified_collection/trace_manager/telemetry/include", 29 ] 30 31 cflags = [ 32 "-D__UNITTEST__", 33 "-frtti", 34 ] 35} 36 37ohos_unittest("TraceManagerTest") { 38 branch_protector_ret = "pac_ret" 39 sanitize = { 40 cfi = true 41 cfi_cross_dso = true 42 cfi_vcall_icall_only = true 43 debug = false 44 } 45 46 module_out_path = hiview_module + "/ucollection" 47 48 configs = [ ":trace_manager_test_config" ] 49 50 sources = [ 51 "trace_manager_test.cpp", 52 "trace_state_test.cpp", 53 "../src/trace_db_callback.cpp", 54 "../src/trace_flow_controller.cpp", 55 "../src/trace_state_machine.cpp", 56 "../state/trace_base_state.cpp", 57 "../state/trace_command_state.cpp", 58 "../state/trace_common_state.cpp", 59 "../state/trace_dynamic_state.cpp", 60 "../state/trace_telemetry_state.cpp", 61 "../storage/app_event_task_storage.cpp", 62 "../storage/telemetry_storage.cpp", 63 "../storage/trace_behavior_storage.cpp", 64 "../storage/trace_storage.cpp", 65 "../telemetry/telemetry_state_machine.cpp", 66 ] 67 68 deps = [ 69 "$hiview_base:hiviewbase", 70 ] 71 72 external_deps = [ 73 "c_utils:utils", 74 "cJSON:cjson", 75 "googletest:gtest_main", 76 "hilog:libhilog", 77 "relational_store:native_rdb", 78 "ffrt:libffrt", 79 "hitrace:hitrace_dump", 80 "hitrace:libhitrace_option", 81 ] 82 83 defines = [ 84 "TRACE_MANAGER_UNITTEST", 85 ] 86} 87