• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021-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.
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_faultloggerd") {
22      output_extension = "bin"
23      output_dir = "$root_out_dir/test/unittest/faultloggerd"
24      sources = [
25        "//base/hiviewdfx/faultloggerd/utils/directory_ex.cpp",
26        "src/faultloggerd_system_test.cpp",
27      ]
28
29      include_dirs = [
30        "include/",
31        "//commonlibrary/c_utils/base/include",
32        "$faultloggerd_path/common",
33        "$faultloggerd_path/tools/process_dump",
34        "$faultloggerd_path/interfaces/innerkits/faultoggerd_client/include",
35        "$faultloggerd_path/interfaces/innerkits/dump_catcher/include",
36        "$faultloggerd_path/utils",
37        "$hilog_lite_include_path",
38      ]
39
40      deps = [
41        "$faultloggerd_path/interfaces/innerkits/dump_catcher:lib_dfx_dump_catcher",
42        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
43      ]
44
45      if (target_cpu == "arm") {
46        cflags = [ "-D__arm__" ]
47      } else if (target_cpu == "arm64") {
48        cflags = [ "-D__aarch64__" ]
49      }
50    }
51  }
52
53  group("systemtest") {
54    deps = [ ":test_faultloggerd" ]
55  }
56} else {
57  import("//build/config/features.gni")
58  import("//build/test.gni")
59
60  config("module_private_config") {
61    visibility = [ ":*" ]
62
63    include_dirs = [
64      "include/",
65      "//commonlibrary/c_utils/base/include",
66      "$faultloggerd_path/interfaces/innerkits/dump_catcher/include/",
67    ]
68
69    cflags_cc = [ "-fno-exceptions" ]
70  }
71
72  module_output_path = "faultloggerd/faultloggerd_native"
73
74  ohos_systemtest("test_faultloggerd") {
75    module_out_path = module_output_path
76    sources = [ "src/faultloggerd_system_test.cpp" ]
77
78    configs = [ ":module_private_config" ]
79
80    deps = [
81      "$faultloggerd_path/interfaces/innerkits/dump_catcher:lib_dfx_dump_catcher",
82      "//third_party/googletest:gtest_main",
83    ]
84
85    external_deps = [
86      "c_utils:utils",
87      "hilog_native:libhilog",
88    ]
89
90    if (target_cpu == "arm") {
91      cflags = [ "-D__arm__" ]
92    } else if (target_cpu == "arm64") {
93      cflags = [ "-D__aarch64__" ]
94    }
95  }
96
97  ohos_systemtest("test_faultloggerd_pre") {
98    module_out_path = module_output_path
99    sources = [ "src/faultloggerd_system_test.cpp" ]
100
101    configs = [ ":module_private_config" ]
102
103    deps = [
104      "$faultloggerd_path/interfaces/innerkits/dump_catcher:lib_dfx_dump_catcher",
105      "//third_party/googletest:gtest_main",
106    ]
107
108    external_deps = [
109      "c_utils:utils",
110      "hilog_native:libhilog",
111    ]
112
113    cflags = [ "-D__pre__" ]
114  }
115
116  group("systemtest") {
117    testonly = true
118    deps = [
119      ":test_faultloggerd",
120      ":test_faultloggerd_pre",
121    ]
122  }
123}
124