• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 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
14#####################hydra-fuzz###################
15import("//build/config/features.gni")
16import("//build/test.gni")
17
18##############################fuzztest##########################################
19ohos_fuzztest("SchemaQueryFuzzTest") {
20  module_out_path = "datamgr_service/distributeddb"
21
22  include_dirs = [
23    "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata/include",
24    "//commonlibrary/c_utils/base/include",
25    "//third_party/jsoncpp/include/json",
26    "//third_party/skia/third_party/externals/spirv-headers/tools/buildHeaders/jsoncpp/dist/json",
27    "//third_party/skia/third_party/externals/swiftshader/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json",
28    "//third_party/jsoncpp/include/json",
29    "//third_party/grpc/src/core/lib/json",
30    "//third_party/sqlite/include",
31    "//third_party/googletest/googletest/include/gtest",
32  ]
33
34  sources = [ "schemaquery_fuzzer.cpp" ]
35
36  cflags = [
37    "-g",
38    "-O0",
39    "-Wno-unused-variable",
40    "-fno-omit-frame-pointer",
41  ]
42
43  fuzz_config_file = "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/test/fuzztest/schemaquery_fuzzer"
44
45  deps = [
46    "//foundation/distributeddatamgr/datamgr_service/services/distributeddataservice/adapter:distributeddata_adapter",
47    "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:distributeddb",
48    "//foundation/distributeddatamgr/kv_store/interfaces/innerkits/distributeddata:distributeddata_inner",
49    "//third_party/jsoncpp:jsoncpp",
50    "//third_party/openssl:libcrypto_shared",
51  ]
52
53  defines = [
54    "SQLITE_ENABLE_SNAPSHOT",
55    "_LARGEFILE64_SOURCE",
56    "_FILE_OFFSET_BITS=64",
57    "SQLITE_HAS_CODEC",
58    "SQLITE_ENABLE_JSON1",
59    "USING_HILOG_LOGGER",
60    "USE_SQLITE_SYMBOLS",
61    "USING_DB_JSON_EXTRACT_AUTOMATICALLY",
62    "LOW_LEVEL_MEM_DEV",
63    "JSONCPP_USE_BUILDER",
64    "OMIT_FLATBUFFER",
65    "RELATIONAL_STORE",
66    "SQLITE_DISTRIBUTE_RELATIONAL",
67    "OPENSSL_SUPPRESS_DEPRECATED",
68  ]
69
70  external_deps = [
71    "c_utils:utils",
72    "hilog:libhilog",
73    "ipc:ipc_core",
74  ]
75}
76
77###############################################################################
78group("fuzztest") {
79  testonly = true
80  deps = []
81  deps += [
82    # deps file
83    ":SchemaQueryFuzzTest",
84  ]
85}
86###############################################################################
87