• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2022-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")
15import("//build/config/features.gni")
16import("//build/test.gni")
17
18module_output_path = "faultloggerd/backtrace"
19
20ohos_unittest("backtrace_utils_test") {
21  module_out_path = module_output_path
22  visibility = [ "*:*" ]
23  include_dirs = [
24    "$faultloggerd_path/common",
25    "$faultloggerd_path/test/utils",
26  ]
27  sources = [ "backtrace_utils_test.cpp" ]
28  deps = [
29    "$faultloggerd_path/common/dfxutil:dfx_util",
30    "$faultloggerd_path/interfaces/innerkits/backtrace:libbacktrace_local",
31    "$faultloggerd_path/test/utils:dfx_test_util",
32    "//third_party/googletest:gtest_main",
33    "//third_party/libunwind:libunwind",
34  ]
35  if (use_musl && use_jemalloc && use_jemalloc_dfx_intf) {
36    defines = [ "USE_JEMALLOC_DFX_INTF" ]
37  }
38  external_deps = [
39    "c_utils:utils",
40    "hilog:libhilog",
41  ]
42}
43
44ohos_unittest("backtrace_local_test") {
45  module_out_path = module_output_path
46  visibility = [ "*:*" ]
47  include_dirs = [
48    "$faultloggerd_path/common",
49    "$faultloggerd_path/test/utils",
50    "$faultloggerd_path/frameworks/unwinder/include",
51    "$faultloggerd_path/interfaces/innerkits/backtrace",
52  ]
53  sources = [ "backtrace_local_test.cpp" ]
54  deps = [
55    "$faultloggerd_path/common/dfxutil:dfx_util",
56    "$faultloggerd_path/interfaces/innerkits/backtrace:libbacktrace_local",
57    "$faultloggerd_path/test/utils:dfx_test_util",
58    "//third_party/bounds_checking_function:libsec_shared",
59    "//third_party/googletest:gtest_main",
60    "//third_party/libunwind:libunwind",
61  ]
62
63  external_deps = [
64    "c_utils:utils",
65    "hilog:libhilog",
66  ]
67}
68
69ohos_unittest("catchframe_local_test") {
70  module_out_path = module_output_path
71  visibility = [ "*:*" ]
72  include_dirs = [
73    "$faultloggerd_path/common",
74    "$faultloggerd_path/test/utils",
75  ]
76  sources = [ "catchframe_local_test.cpp" ]
77  deps = [
78    "$faultloggerd_path/common/dfxutil:dfx_util",
79    "$faultloggerd_path/interfaces/innerkits/backtrace:libbacktrace_local",
80    "$faultloggerd_path/test/utils:dfx_test_util",
81    "//third_party/bounds_checking_function:libsec_shared",
82    "//third_party/googletest:gtest_main",
83    "//third_party/libunwind:libunwind",
84  ]
85
86  external_deps = [
87    "c_utils:utils",
88    "hilog:libhilog",
89  ]
90}
91
92group("unittest") {
93  testonly = true
94  deps = [
95    ":backtrace_local_test",
96    ":backtrace_utils_test",
97    ":catchframe_local_test",
98  ]
99}
100