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. 13 14#####################hydra-fuzz################### 15import("//build/ohos.gni") 16import("//build/test.gni") 17import("../../test_ts.gni") 18 19##############################fuzztest########################################## 20ohos_fuzztest("ts_bytrace_fuzz_test") { 21 include_dirs = [ 22 "../../../src", 23 "../../../src/base", 24 "../../../src/table", 25 "../../../src/filter", 26 "../../../src/trace_data", 27 "../../../src/parser", 28 "../../../src/trace_streamer", 29 "../../../src/include", 30 "../../../src/parser/bytrace_parser", 31 "../../../src/cfg", 32 "../../../src/parser/htrace_parser", 33 "../../../src/parser/htrace_parser/htrace_event_parser", 34 "../../../src/parser/htrace_parser/htrace_cpu_parser", 35 "//third_party/sqlite/include", 36 "${OHOS_PROTO_GEN}/types/plugins/memory_data", 37 "${OHOS_PROTO_GEN}/types/plugins/ftrace_data/${kernel_version}", 38 "${OHOS_PROTO_GEN}/types/plugins/hilog_data", 39 "${OHOS_PROTO_GEN}/types/plugins/native_hook", 40 "${OHOS_PROTO_GEN}/types/plugins/hidump_data", 41 "${OHOS_PROTO_GEN}/types/plugins/network_data", 42 "${OHOS_PROTO_GEN}/types/plugins/cpu_data", 43 "${OHOS_PROTO_GEN}/types/plugins/diskio_data", 44 "${OHOS_PROTO_GEN}/types/plugins/process_data", 45 "${OHOS_PROTO_GEN}/types/plugins/hisysevent_data", 46 "${OHOS_PROTO_GEN}", 47 "//third_party/protobuf/src", 48 ] 49 cflags = [ 50 "-g", 51 "-O0", 52 "-Wno-unused-variable", 53 "-fno-omit-frame-pointer", 54 ] 55 sources = [ "bytrace_fuzzer.cpp" ] 56 ldflags = [ 57 "-fprofile-arcs", 58 "-ftest-coverage", 59 "--coverage", 60 ] 61 deps = [ 62 "../../../src:trace_streamer_source", 63 "//prebuilts/protos:ts_proto_data_cpp", 64 "//third_party/protobuf:protobuf", 65 "//third_party/protobuf:protobuf_lite", 66 "//third_party/sqlite:sqlite", 67 ] 68} 69 70############################################################################### 71group("fuzztest") { 72 testonly = true 73 deps = [] 74 deps += [ 75 # deps file 76 ":ts_bytrace_fuzz_test", 77 ] 78} 79############################################################################### 80