153c3577eSopenharmony_ci# Copyright (c) 2021 Huawei Device Co., Ltd.
253c3577eSopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License");
353c3577eSopenharmony_ci# you may not use this file except in compliance with the License.
453c3577eSopenharmony_ci# You may obtain a copy of the License at
553c3577eSopenharmony_ci#
653c3577eSopenharmony_ci#     http://www.apache.org/licenses/LICENSE-2.0
753c3577eSopenharmony_ci#
853c3577eSopenharmony_ci# Unless required by applicable law or agreed to in writing, software
953c3577eSopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS,
1053c3577eSopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1153c3577eSopenharmony_ci# See the License for the specific language governing permissions and
1253c3577eSopenharmony_ci# limitations under the License.
1353c3577eSopenharmony_ciimport("//build/test.gni")
1453c3577eSopenharmony_ciimport("//foundation/distributeddatamgr/datamgr_service/datamgr_service.gni")
1553c3577eSopenharmony_ci
1653c3577eSopenharmony_cimodule_output_path = "datamgr_service/distributeddatafwk"
1753c3577eSopenharmony_ci
1853c3577eSopenharmony_ci###############################################################################
1953c3577eSopenharmony_ciconfig("module_dfx_mst_config") {
2053c3577eSopenharmony_ci  visibility = [ ":*" ]
2153c3577eSopenharmony_ci
2253c3577eSopenharmony_ci  include_dirs = [
2353c3577eSopenharmony_ci    "../src",
2453c3577eSopenharmony_ci    "../src/fault",
2553c3577eSopenharmony_ci    "../src/statistic",
2653c3577eSopenharmony_ci    "../../include/log",
2753c3577eSopenharmony_ci    "../../include/autils",
2853c3577eSopenharmony_ci    "../../include/dfx",
2953c3577eSopenharmony_ci    "${kv_store_path}/interfaces/inner_api/distributeddata/include",
3053c3577eSopenharmony_ci    "//commonlibrary/c_utils/base/include",
3153c3577eSopenharmony_ci    "//utils/system/safwk/native/include",
3253c3577eSopenharmony_ci    "//third_party/openssl/include/",
3353c3577eSopenharmony_ci    "//foundation/distributeddatamgr/kv_store/frameworks/common",
3453c3577eSopenharmony_ci  ]
3553c3577eSopenharmony_ci}
3653c3577eSopenharmony_ci
3753c3577eSopenharmony_ciohos_unittest("DistributeddataDfxMSTTest") {
3853c3577eSopenharmony_ci  module_out_path = module_output_path
3953c3577eSopenharmony_ci
4053c3577eSopenharmony_ci  sources = [ "./unittest/distributeddata_dfx_mst_test.cpp" ]
4153c3577eSopenharmony_ci
4253c3577eSopenharmony_ci  configs = [ ":module_dfx_mst_config" ]
4353c3577eSopenharmony_ci
4453c3577eSopenharmony_ci  external_deps = [
4553c3577eSopenharmony_ci    "c_utils:utils",
4653c3577eSopenharmony_ci    "hilog:libhilog",
4753c3577eSopenharmony_ci    "hisysevent:libhisysevent",
4853c3577eSopenharmony_ci    "hitrace:hitrace_meter",
4953c3577eSopenharmony_ci    "kv_store:distributeddata_inner",
5053c3577eSopenharmony_ci  ]
5153c3577eSopenharmony_ci  ldflags = [ "-Wl,--exclude-libs,ALL" ]
5253c3577eSopenharmony_ci  deps = [
5353c3577eSopenharmony_ci    "../../dfx:distributeddata_dfx_static",
5453c3577eSopenharmony_ci    "//third_party/googletest:gtest_main",
5553c3577eSopenharmony_ci    "//third_party/openssl:libcrypto_shared",
5653c3577eSopenharmony_ci  ]
5753c3577eSopenharmony_ci  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
5853c3577eSopenharmony_ci}
5953c3577eSopenharmony_ci
6053c3577eSopenharmony_ci###############################################################################
6153c3577eSopenharmony_ciconfig("module_dfx_config") {
6253c3577eSopenharmony_ci  visibility = [ ":*" ]
6353c3577eSopenharmony_ci
6453c3577eSopenharmony_ci  include_dirs = [
6553c3577eSopenharmony_ci    "./unittest/fake/hiview/include",
6653c3577eSopenharmony_ci    "./unittest/fake/hiview",
6753c3577eSopenharmony_ci    "../src",
6853c3577eSopenharmony_ci    "../src/fault",
6953c3577eSopenharmony_ci    "../src/statistic",
7053c3577eSopenharmony_ci    "../../include/log",
7153c3577eSopenharmony_ci    "../../include/autils",
7253c3577eSopenharmony_ci    "../../include/dfx",
7353c3577eSopenharmony_ci    "//commonlibrary/c_utils/base/include",
7453c3577eSopenharmony_ci    "//utils/system/safwk/native/include",
7553c3577eSopenharmony_ci    "//third_party/openssl/include/",
7653c3577eSopenharmony_ci    "//foundation/distributeddatamgr/kv_store/frameworks/common",
7753c3577eSopenharmony_ci  ]
7853c3577eSopenharmony_ci}
7953c3577eSopenharmony_ci
8053c3577eSopenharmony_ciohos_unittest("DistributeddataDfxUTTest") {
8153c3577eSopenharmony_ci  module_out_path = module_output_path
8253c3577eSopenharmony_ci
8353c3577eSopenharmony_ci  sources = [
8453c3577eSopenharmony_ci    "../src/behaviour/behaviour_reporter_impl.cpp",
8553c3577eSopenharmony_ci    "../src/fault/communication_fault_impl.cpp",
8653c3577eSopenharmony_ci    "../src/fault/database_fault_impl.cpp",
8753c3577eSopenharmony_ci    "../src/fault/fault_reporter.cpp",
8853c3577eSopenharmony_ci    "../src/fault/runtime_fault_impl.cpp",
8953c3577eSopenharmony_ci    "../src/fault/service_fault_impl.cpp",
9053c3577eSopenharmony_ci    "../src/hiview_adapter.cpp",
9153c3577eSopenharmony_ci    "../src/reporter.cpp",
9253c3577eSopenharmony_ci    "../src/statistic/api_performance_statistic_impl.cpp",
9353c3577eSopenharmony_ci    "../src/statistic/database_statistic_impl.cpp",
9453c3577eSopenharmony_ci    "../src/statistic/statistic_reporter.cpp",
9553c3577eSopenharmony_ci    "../src/statistic/traffic_statistic_impl.cpp",
9653c3577eSopenharmony_ci    "../src/statistic/visit_statistic_impl.cpp",
9753c3577eSopenharmony_ci    "./unittest/distributeddata_dfx_ut_test.cpp",
9853c3577eSopenharmony_ci    "./unittest/fake/hiview/fake_hiview.cpp",
9953c3577eSopenharmony_ci  ]
10053c3577eSopenharmony_ci
10153c3577eSopenharmony_ci  configs = [ ":module_dfx_config" ]
10253c3577eSopenharmony_ci
10353c3577eSopenharmony_ci  external_deps = [
10453c3577eSopenharmony_ci    "c_utils:utils",
10553c3577eSopenharmony_ci    "hilog:libhilog",
10653c3577eSopenharmony_ci    "hisysevent:libhisysevent",
10753c3577eSopenharmony_ci    "hitrace:hitrace_meter",
10853c3577eSopenharmony_ci    "kv_store:distributeddata_inner",
10953c3577eSopenharmony_ci  ]
11053c3577eSopenharmony_ci  ldflags = [ "-Wl,--exclude-libs,ALL" ]
11153c3577eSopenharmony_ci  deps = [
11253c3577eSopenharmony_ci    "//third_party/googletest:gtest_main",
11353c3577eSopenharmony_ci    "//third_party/openssl:libcrypto_shared",
11453c3577eSopenharmony_ci  ]
11553c3577eSopenharmony_ci  defines = [ "OPENSSL_SUPPRESS_DEPRECATED" ]
11653c3577eSopenharmony_ci}
11753c3577eSopenharmony_ci
11853c3577eSopenharmony_ci###############################################################################
11953c3577eSopenharmony_cigroup("unittest") {
12053c3577eSopenharmony_ci  testonly = true
12153c3577eSopenharmony_ci  deps = []
12253c3577eSopenharmony_ci
12353c3577eSopenharmony_ci  deps += [
12453c3577eSopenharmony_ci    ":DistributeddataDfxMSTTest",
12553c3577eSopenharmony_ci    ":DistributeddataDfxUTTest",
12653c3577eSopenharmony_ci  ]
12753c3577eSopenharmony_ci}
12853c3577eSopenharmony_ci###############################################################################
129