1# Copyright (c) 2021-2023 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. 13 14import("//base/hiviewdfx/faultloggerd/faultloggerd.gni") 15 16if (defined(ohos_lite)) { 17 import("//build/lite/config/component/lite_component.gni") 18 import("//build/lite/config/test.gni") 19 20 if (ohos_build_type == "debug") { 21 unittest("test_dumpcatcher_performance") { 22 output_extension = "bin" 23 output_dir = "$root_out_dir/test/unittest/faultloggerd" 24 sources = [ "src/faultloggerd_performance_test.cpp" ] 25 26 include_dirs = [ 27 "include/", 28 "$c_utils_include_path", 29 "$faultloggerd_frameworks_path/unwinder/include", 30 "$faultloggerd_interfaces_path/common", 31 "$faultloggerd_interfaces_path/innerkits/procinfo/include", 32 "$faultloggerd_path/common", 33 "$faultloggerd_path/tools/process_dump", 34 "$faultloggerd_path/interfaces/innerkits/backtrace/include/", 35 "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include", 36 "$faultloggerd_path/interfaces/innerkits/dump_catcher/include/", 37 "$faultloggerd_path/test/utils", 38 "$hilog_lite_include_path", 39 ] 40 41 deps = [ 42 "$faultloggerd_path/interfaces/innerkits/backtrace:libbacktrace_local", 43 "$faultloggerd_path/interfaces/innerkits/dump_catcher:libdfx_dumpcatcher", 44 "$faultloggerd_path/test/utils:dfx_test_util", 45 "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared", 46 ] 47 } 48 } 49 50 group("performance") { 51 deps = [ ":test_dumpcatcher_performance" ] 52 } 53} else { 54 import("//build/config/features.gni") 55 import("//build/test.gni") 56 57 config("module_private_config") { 58 visibility = [ ":*" ] 59 60 include_dirs = [ 61 "include/", 62 "$faultloggerd_interfaces_path/common", 63 "$faultloggerd_interfaces_path/innerkits/backtrace/include/", 64 "$faultloggerd_interfaces_path/innerkits/dump_catcher/include/", 65 "$faultloggerd_path/common", 66 "$faultloggerd_path/test/utils", 67 ] 68 } 69 70 module_output_path = "faultloggerd/faultloggerd_native" 71 72 ohos_performancetest("test_dumpcatcher_performance") { 73 module_out_path = module_output_path 74 sources = [ "src/faultloggerd_performance_test.cpp" ] 75 76 configs = [ ":module_private_config" ] 77 78 deps = [ 79 "$faultloggerd_path/interfaces/innerkits/backtrace:libbacktrace_local", 80 "$faultloggerd_path/interfaces/innerkits/dump_catcher:libdfx_dumpcatcher", 81 "$faultloggerd_path/test/utils:dfx_test_util", 82 "//third_party/googletest:gtest_main", 83 ] 84 external_deps = [ 85 "c_utils:utils", 86 "hilog:libhilog", 87 ] 88 } 89 90 group("performance") { 91 testonly = true 92 deps = [ ":test_dumpcatcher_performance" ] 93 } 94} 95