• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2021 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/test.gni")
15module_output_path = "hiviewdfx/faultlogger/"
16
17config("hiview_faultlogger_test_config") {
18  visibility = [ ":*" ]
19
20  include_dirs = [
21    ".",
22    "$hiview_core",
23    "$hiview_faultlogger/service/",
24    "common",
25    "common/unittest",
26  ]
27
28  cflags_cc = [ "-DUNITTEST" ]
29}
30
31ohos_unittest("FaultloggerUnittest") {
32  module_out_path = module_output_path
33
34  configs = [ ":hiview_faultlogger_test_config" ]
35
36  sources = [
37    "$hiview_faultlogger/service/faultlog_database.cpp",
38    "$hiview_faultlogger/service/faultlog_formatter.cpp",
39    "$hiview_faultlogger/service/faultlog_manager.cpp",
40    "$hiview_faultlogger/service/faultlogger.cpp",
41    "common/unittest/faultlogger_unittest.cpp",
42  ]
43
44  deps = [
45    "$hiview_adapter/system_service:system_service",
46    "$hiview_adapter/utility:hiview_adapter_utility",
47    "$hiview_base:hiviewbase",
48    "$hiview_core:hiview_core",
49    "$hiview_plugin/faultlogger/common:faultlogger_common",
50    "$hiview_plugin/faultlogger/service:faultlogger_service_ability",
51    "//third_party/googletest:gtest_main",
52  ]
53
54  external_deps = [
55    "hilog_native:libhilog",
56    "ipc:ipc_core",
57    "samgr_standard:samgr_proxy",
58  ]
59}
60
61ohos_unittest("FaultloggerClientUnittest") {
62  module_out_path = module_output_path
63
64  configs = [ ":hiview_faultlogger_test_config" ]
65
66  sources = [
67    "common/faultlogger_client_test.cpp",
68    "common/unittest/faultlogger_client_unittest.cpp",
69  ]
70
71  deps = [
72    "$hiview_base:hiviewbase",
73    "$hiview_faultlogger:libfaultlogger",
74    "//third_party/googletest:gtest_main",
75  ]
76}
77