• 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("//build/test.gni")
14
15module_output_path = "datamgr_service/distributeddatafwk"
16
17###############################################################################
18config("module_dfx_mst_config") {
19  visibility = [ ":*" ]
20
21  include_dirs = [
22    "../src",
23    "../src/fault",
24    "../src/statistic",
25    "../../include/log",
26    "../../include/autils",
27    "../../include/dfx",
28    "//commonlibrary/c_utils/base/include",
29    "//utils/system/safwk/native/include",
30    "//third_party/openssl/include/",
31    "//foundation/distributeddatamgr/kv_store/frameworks/common",
32  ]
33}
34
35ohos_unittest("DistributeddataDfxMSTTest") {
36  module_out_path = module_output_path
37
38  sources = [ "./unittest/distributeddata_dfx_mst_test.cpp" ]
39
40  configs = [ ":module_dfx_mst_config" ]
41
42  external_deps = [
43    "c_utils:utils",
44    "hilog:libhilog",
45    "hisysevent:libhisysevent",
46    "hitrace:hitrace_meter",
47  ]
48  ldflags = [ "-Wl,--exclude-libs,ALL" ]
49  deps = [
50    "../../dfx:distributeddata_dfx_static",
51    "//third_party/googletest:gtest_main",
52    "//third_party/openssl:libcrypto_shared",
53  ]
54  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
55}
56
57###############################################################################
58config("module_dfx_config") {
59  visibility = [ ":*" ]
60
61  include_dirs = [
62    "./unittest/fake/hiview/include",
63    "./unittest/fake/hiview",
64    "../src",
65    "../src/fault",
66    "../src/statistic",
67    "../../include/log",
68    "../../include/autils",
69    "../../include/dfx",
70    "//commonlibrary/c_utils/base/include",
71    "//utils/system/safwk/native/include",
72    "//third_party/openssl/include/",
73    "//foundation/distributeddatamgr/kv_store/frameworks/common",
74  ]
75}
76
77ohos_unittest("DistributeddataDfxUTTest") {
78  module_out_path = module_output_path
79
80  sources = [
81    "../src/behaviour/behaviour_reporter_impl.cpp",
82    "../src/fault/communication_fault_impl.cpp",
83    "../src/fault/database_fault_impl.cpp",
84    "../src/fault/fault_reporter.cpp",
85    "../src/fault/runtime_fault_impl.cpp",
86    "../src/fault/service_fault_impl.cpp",
87    "../src/hiview_adapter.cpp",
88    "../src/reporter.cpp",
89    "../src/statistic/api_performance_statistic_impl.cpp",
90    "../src/statistic/database_statistic_impl.cpp",
91    "../src/statistic/statistic_reporter.cpp",
92    "../src/statistic/traffic_statistic_impl.cpp",
93    "../src/statistic/visit_statistic_impl.cpp",
94    "./unittest/distributeddata_dfx_ut_test.cpp",
95    "./unittest/fake/hiview/fake_hiview.cpp",
96  ]
97
98  configs = [ ":module_dfx_config" ]
99
100  external_deps = [
101    "c_utils:utils",
102    "hilog:libhilog",
103    "hisysevent:libhisysevent",
104    "hitrace:hitrace_meter",
105  ]
106  ldflags = [ "-Wl,--exclude-libs,ALL" ]
107  deps = [
108    "//third_party/googletest:gtest_main",
109    "//third_party/openssl:libcrypto_shared",
110  ]
111  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
112}
113
114###############################################################################
115group("unittest") {
116  testonly = true
117  deps = []
118
119  deps += [
120    ":DistributeddataDfxMSTTest",
121    ":DistributeddataDfxUTTest",
122  ]
123}
124###############################################################################
125