1# Copyright (c) 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_procinfo") { 22 output_extension = "bin" 23 output_dir = "$root_out_dir/test/unittest/faultloggerd" 24 25 include_dirs = [ 26 "$c_utils_include_path", 27 "$faultloggerd_interfaces_path/common", 28 "$faultloggerd_path/common/dfxlog", 29 "$faultloggerd_path/common/dfxutil", 30 "$faultloggerd_path/interfaces/innerkits/procinfo/include", 31 "$hilog_lite_include_path", 32 ] 33 34 sources = [ "procinfo_test.cpp" ] 35 36 deps = [ 37 "$faultloggerd_path/common/dfxlog:dfx_hilog", 38 "$faultloggerd_path/common/dfxutil:dfx_util", 39 "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo", 40 "$hilog_lite_deps_path", 41 ] 42 } 43 } 44 45 group("unittest") { 46 deps = [ ":test_procinfo" ] 47 } 48} else { 49 import("//build/config/features.gni") 50 import("//build/test.gni") 51 52 config("module_private_config") { 53 visibility = [ ":*" ] 54 55 include_dirs = [ "$faultloggerd_interfaces_path/common" ] 56 } 57 58 module_output_path = "faultloggerd/procinfo" 59 60 ohos_unittest("test_procinfo") { 61 module_out_path = module_output_path 62 sources = [ "procinfo_test.cpp" ] 63 64 configs = [ ":module_private_config" ] 65 66 deps = [ 67 "$faultloggerd_path/common/dfxutil:dfx_util", 68 "$faultloggerd_path/interfaces/innerkits/procinfo:libdfx_procinfo", 69 ] 70 71 external_deps = [ 72 "c_utils:utils", 73 "googletest:gmock_main", 74 "googletest:gtest_main", 75 ] 76 } 77 78 group("unittest") { 79 testonly = true 80 deps = [ ":test_procinfo" ] 81 } 82} 83