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_error_info_handle.cpp",
36  "../panic_report_recovery.cpp",
37  "mock/bbox_detectors_mock.cpp",
38  "mock/hisysevent_util_mock.cpp",
39]
40
41ohos_unittest("BBoxDetectorUnitTest") {
42  sources = [ "unittest/bbox_detector_unit_test.cpp" ]
43
44  sources += bbox_detector_test_source
45
46  configs = [ ":bbox_detector_test_config" ]
47
48  external_deps = [
49    "bounds_checking_function:libsec_shared",
50    "googletest:gmock",
51    "googletest:gtest_main",
52    "hilog:libhilog",
53    "hisysevent:libhisysevent",
54    "init:libbegetutil",
55    "zlib:shared_libz",
56  ]
57
58  cflags = [ "-DUNITTEST" ]
59
60  deps = [
61    "$hiview_base:hiviewbase_static_lib_for_tdd",
62    "$hiview_base/event_store:event_store_source",
63    "$hiview_root/utility/common_utils:hiview_reliability_common_utils",
64    "$hiview_root/utility/smart_parser:smart_parser",
65  ]
66
67  module_out_path = module_output_path
68}
69
70ohos_moduletest("BBoxDetectorModuleTest") {
71  sources = [ "moduletest/bbox_detector_module_test.cpp" ]
72
73  sources += bbox_detector_test_source
74
75  configs = [ ":bbox_detector_test_config" ]
76
77  cflags = [ "-DUNITTEST" ]
78
79  external_deps = [
80    "bounds_checking_function:libsec_shared",
81    "googletest:gmock",
82    "googletest:gtest_main",
83    "hilog:libhilog",
84    "hisysevent:libhisysevent",
85    "init:libbegetutil",
86    "zlib:shared_libz",
87  ]
88
89  deps = [
90    "$hiview_base:hiviewbase_static_lib_for_tdd",
91    "$hiview_base/event_store:event_store_source",
92    "$hiview_root/utility/common_utils:hiview_reliability_common_utils",
93    "$hiview_root/utility/smart_parser:smart_parser",
94  ]
95
96  module_out_path = module_output_path
97}
98