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("KvStoreDiskSizeFuzzTest") { 20 module_out_path = "datamgr_service/distributeddatafwk" 21 22 include_dirs = [ 23 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/fuzztest/common", 24 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/common", 25 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/syncer", 26 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/storage", 27 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/include", 28 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/interfaces/include", 29 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/interfaces/src", 30 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/include", 31 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/src", 32 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/src/sqlite", 33 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/storage/src/multiver", 34 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/include", 35 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src", 36 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/communicator/include", 37 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/communicator/src", 38 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/syncer/include", 39 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/syncer/src", 40 "//commonlibrary/c_utils/base/include", 41 "//third_party/sqlite/include", 42 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/include/relational", 43 "//third_party/jsoncpp/include/json", 44 "//third_party/skia/third_party/externals/spirv-headers/tools/buildHeaders/jsoncpp/dist/json", 45 "//third_party/skia/third_party/externals/swiftshader/third_party/SPIRV-Headers/tools/buildHeaders/jsoncpp/dist/json", 46 "//third_party/jsoncpp/include/json", 47 "//third_party/grpc/src/core/lib/json", 48 ] 49 50 fuzz_config_file = "//foundation/distributeddatamgr/datamgr_service/test/fuzztest/kvstoredisksize_fuzzer" 51 52 cflags = [ 53 "-g", 54 "-O0", 55 "-Wno-unused-variable", 56 "-fno-omit-frame-pointer", 57 ] 58 59 sources = [ 60 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/db_common.cpp", 61 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/log_print.cpp", 62 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/platform_specific.cpp", 63 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/fuzztest/common/distributeddb_tools_test.cpp", 64 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/common/distributeddb_data_generate_unit_test.cpp", 65 "kvstoredisksize_fuzzer.cpp", 66 ] 67 68 defines = [ 69 "SQLITE_ENABLE_SNAPSHOT", 70 "_LARGEFILE64_SOURCE", 71 "_FILE_OFFSET_BITS=64", 72 "SQLITE_HAS_CODEC", 73 "SQLITE_ENABLE_JSON1", 74 "USING_HILOG_LOGGER", 75 "USE_SQLITE_SYMBOLS", 76 "USING_DB_JSON_EXTRACT_AUTOMATICALLY", 77 "LOW_LEVEL_MEM_DEV", 78 "JSONCPP_USE_BUILDER", 79 "OMIT_FLATBUFFER", 80 "RELATIONAL_STORE", 81 "SQLITE_DISTRIBUTE_RELATIONAL", 82 ] 83 84 deps = [ 85 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:distributeddb", 86 "//third_party/jsoncpp:jsoncpp", 87 "//third_party/openssl:libcrypto_shared", 88 ] 89 90 external_deps = [ 91 "c_utils:utils", 92 "hiviewdfx_hilog_native:libhilog", 93 ] 94} 95 96############################################################################### 97group("fuzztest") { 98 testonly = true 99 deps = [] 100 deps += [ 101 # deps file 102 ":KvStoreDiskSizeFuzzTest", 103 ] 104} 105############################################################################### 106