1# Copyright (c) 2022 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/ohos.gni") 15import("//build/test.gni") 16 17module_output_path = "hiview/hiview//bbox_detector" 18 19config("bbox_detector_test_config") { 20 visibility = [ ":*" ] 21 include_dirs = [ 22 "../", 23 "../include", 24 "moduletest", 25 "mock", 26 "unittest", 27 "$hiview_root/utility/common_utils/include", 28 "$hiview_root/utility/smart_parser", 29 "$hiview_root/utility/smart_parser/feature_analysis/include", 30 ] 31} 32 33bbox_detector_test_source = [ 34 "../bbox_detector_plugin.cpp", 35 "../panic_report_recovery.cpp", 36 "mock/bbox_detectors_mock.cpp", 37 "mock/hisysevent_util_mock.cpp", 38] 39 40ohos_unittest("BBoxDetectorUnitTest") { 41 sources = [ "unittest/bbox_detector_unit_test.cpp" ] 42 43 sources += bbox_detector_test_source 44 45 configs = [ ":bbox_detector_test_config" ] 46 47 external_deps = [ 48 "bounds_checking_function:libsec_shared", 49 "googletest:gmock", 50 "googletest:gtest_main", 51 "hilog:libhilog", 52 "hisysevent:libhisysevent", 53 "init:libbegetutil", 54 "zlib:shared_libz", 55 ] 56 57 cflags = [ "-DUNITTEST" ] 58 59 deps = [ 60 "$hiview_base:hiviewbase_static_lib_for_tdd", 61 "$hiview_base/event_store:event_store_source", 62 "$hiview_root/utility/common_utils:hiview_reliability_common_utils", 63 "$hiview_root/utility/smart_parser:smart_parser", 64 ] 65 66 module_out_path = module_output_path 67} 68 69ohos_moduletest("BBoxDetectorModuleTest") { 70 sources = [ "moduletest/bbox_detector_module_test.cpp" ] 71 72 sources += bbox_detector_test_source 73 74 configs = [ ":bbox_detector_test_config" ] 75 76 cflags = [ "-DUNITTEST" ] 77 78 external_deps = [ 79 "bounds_checking_function:libsec_shared", 80 "googletest:gmock", 81 "googletest:gtest_main", 82 "hilog:libhilog", 83 "hisysevent:libhisysevent", 84 "init:libbegetutil", 85 "zlib:shared_libz", 86 ] 87 88 deps = [ 89 "$hiview_base:hiviewbase_static_lib_for_tdd", 90 "$hiview_base/event_store:event_store_source", 91 "$hiview_root/utility/common_utils:hiview_reliability_common_utils", 92 "$hiview_root/utility/smart_parser:smart_parser", 93 ] 94 95 module_out_path = module_output_path 96} 97