• 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")
15
16config("module_private_config") {
17  visibility = [ ":*" ]
18  include_dirs = [
19    "include",
20    "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include",
21    "$faultloggerd_interfaces_path/common",
22    "$faultloggerd_path/test/utils",
23  ]
24}
25
26if (defined(ohos_lite)) {
27  import("//build/lite/config/component/lite_component.gni")
28  import("//build/lite/config/test.gni")
29
30  if (ohos_build_type == "debug") {
31    unittest("FaultloggerdModuleTest") {
32      output_extension = "bin"
33      output_dir = "$root_out_dir/test/unittest/faultloggerd"
34      configs = [ ":module_private_config" ]
35      sources = [ "faultloggerd_module_test.cpp" ]
36      deps = [
37        "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
38        "$faultloggerd_path/test/utils:dfx_test_util",
39      ]
40
41      external_deps = [ "hilog_lite:hilog_shared" ]
42    }
43  }
44
45  group("moduletest") {
46    if (ohos_build_type == "debug") {
47      deps = [ ":FaultloggerdModuleTest" ]
48    }
49  }
50} else {
51  import("//build/config/features.gni")
52  import("//build/test.gni")
53
54  module_output_path = "faultloggerd/faultloggerd/faultloggerd_native"
55
56  ohos_moduletest("FaultloggerdModuleTest") {
57    module_out_path = module_output_path
58    sources = [ "faultloggerd_module_test.cpp" ]
59    configs = [
60      ":module_private_config",
61      "$faultloggerd_path/common/build:coverage_flags",
62    ]
63    deps = [
64      "$faultloggerd_path/common/dfxutil:dfx_util",
65      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
66      "$faultloggerd_path/test/utils:dfx_test_util",
67    ]
68    external_deps = [
69      "c_utils:utils",
70      "googletest:gtest_main",
71    ]
72  }
73
74  group("moduletest") {
75    testonly = true
76    deps = [ ":FaultloggerdModuleTest" ]
77  }
78}
79