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("AutoLaunchFuzzTest") { 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/autolaunch_fuzzer" 51 52 cflags = [ 53 "-g", 54 "-O0", 55 "-Wno-unused-variable", 56 "-fno-omit-frame-pointer", 57 ] 58 sources = [ 59 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/db_common.cpp", 60 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/log_print.cpp", 61 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/common/src/platform_specific.cpp", 62 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/fuzztest/common/distributeddb_tools_test.cpp", 63 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb/test/unittest/common/common/distributeddb_data_generate_unit_test.cpp", 64 "autolaunch_fuzzer.cpp", 65 ] 66 67 defines = [ 68 "SQLITE_ENABLE_SNAPSHOT", 69 "_LARGEFILE64_SOURCE", 70 "_FILE_OFFSET_BITS=64", 71 "SQLITE_HAS_CODEC", 72 "SQLITE_ENABLE_JSON1", 73 "USING_HILOG_LOGGER", 74 "USE_SQLITE_SYMBOLS", 75 "USING_DB_JSON_EXTRACT_AUTOMATICALLY", 76 "LOW_LEVEL_MEM_DEV", 77 "JSONCPP_USE_BUILDER", 78 "OMIT_FLATBUFFER", 79 "RELATIONAL_STORE", 80 "SQLITE_DISTRIBUTE_RELATIONAL", 81 ] 82 83 deps = [ 84 "//foundation/distributeddatamgr/kv_store/frameworks/libs/distributeddb:distributeddb", 85 "//third_party/jsoncpp:jsoncpp", 86 "//third_party/openssl:libcrypto_shared", 87 ] 88 89 external_deps = [ 90 "c_utils:utils", 91 "hiviewdfx_hilog_native:libhilog", 92 ] 93} 94 95############################################################################### 96group("fuzztest") { 97 testonly = true 98 deps = [] 99 deps += [ 100 # deps file 101 ":AutoLaunchFuzzTest", 102 ] 103} 104############################################################################### 105