• 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_service") {
22      output_extension = "bin"
23      output_dir = "$root_out_dir/test/unittest/faultloggerd"
24
25      include_dirs = [
26        "include",
27        "//commonlibrary/c_utils/base/include",
28        "$faultloggerd_path/services",
29        "$hilog_lite_include_path",
30        "$faultloggerd_path/tools/process_dump",
31        "$faultloggerd_path/interfaces/innerkits/faultloggerd_client/include",
32        "$faultloggerd_path/common",
33        "$faultloggerd_path/common/dfxlog",
34        "$faultloggerd_path/utils",
35      ]
36
37      sources = [
38        "$faultloggerd_path/services/fault_logger_config.cpp",
39        "$faultloggerd_path/services/fault_logger_daemon.cpp",
40        "$faultloggerd_path/services/fault_logger_pipe.cpp",
41        "$faultloggerd_path/services/fault_logger_secure.cpp",
42        "//base/hiviewdfx/faultloggerd/utils/directory_ex.cpp",
43        "src/faultlogger_config_test.cpp",
44        "src/faultlogger_daemon_test.cpp",
45        "src/faultlogger_secure_test.cpp",
46      ]
47
48      deps = [
49        "$faultloggerd_path/common/dfxlog:static_common_log",
50        "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
51        "//base/hiviewdfx/hilog_lite/frameworks/featured:hilog_shared",
52      ]
53    }
54  }
55
56  group("unittest") {
57    deps = [ ":test_service" ]
58  }
59} else {
60  import("//build/config/features.gni")
61  import("//build/test.gni")
62
63  config("module_private_config") {
64    visibility = [ ":*" ]
65
66    include_dirs = [
67      "include",
68      "//commonlibrary/c_utils/base/include",
69      "$faultloggerd_path/services",
70      "$faultloggerd_path/common/dfxlog",
71    ]
72  }
73
74  ohos_unittest("test_service") {
75    module_out_path = "faultloggerd/services"
76    sources = [
77      "$faultloggerd_path/services/fault_logger_config.cpp",
78      "$faultloggerd_path/services/fault_logger_daemon.cpp",
79      "$faultloggerd_path/services/fault_logger_pipe.cpp",
80      "$faultloggerd_path/services/fault_logger_secure.cpp",
81      "src/faultlogger_config_test.cpp",
82      "src/faultlogger_daemon_test.cpp",
83      "src/faultlogger_secure_test.cpp",
84    ]
85
86    configs = [ ":module_private_config" ]
87
88    deps = [
89      "$faultloggerd_path/common/dfxlog:static_common_log",
90      "$faultloggerd_path/interfaces/innerkits/faultloggerd_client:libfaultloggerd",
91      "//third_party/googletest:gmock_main",
92      "//third_party/googletest:gtest_main",
93    ]
94
95    external_deps = [
96      "c_utils:utils",
97      "hilog_native:libhilog",
98    ]
99  }
100
101  group("unittest") {
102    testonly = true
103    deps = [ ":test_service" ]
104  }
105}
106