1# Copyright (c) Huawei Technologies Co., Ltd. 2023. All rights reserved.
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_selector_fuzz_test") {
21  include_dirs = [
22    "../../../src/proto_reader/include",
23    "../../../src",
24    "../../../src/base",
25    "../../../src/table",
26    "../../../src/filter",
27    "../../../src/trace_data",
28    "../../../src/parser",
29    "../../../src/trace_streamer",
30    "../../../src/include",
31    "../../../src/parser/ptreader_parser",
32    "../../../src/cfg",
33    "../../../src/metrics",
34    "${THIRD_PARTY}/sqlite/include",
35    "${THIRD_PARTY}/protobuf/src",
36    "${THIRD_PARTY}/bounds_checking_function/include",
37    "${THIRD_PARTY}/json/single_include/nlohmann",
38  ]
39  include_dirs += [
40    "${TRACE_STDTYPE}",
41    "${TRACE_STDTYPE}/ftrace",
42    "${TRACE_STDTYPE}/ftrace/template",
43    "${TRACE_STDTYPE}/hilog",
44    "${TRACE_STDTYPE}/hiperf",
45    "${TRACE_STDTYPE}/hisysevent",
46    "${TRACE_STDTYPE}/htrace",
47    "${TRACE_STDTYPE}/measure",
48  ]
49  cflags = [
50    "-g",
51    "-O0",
52    "-Wno-unused-variable",
53    "-fno-omit-frame-pointer",
54  ]
55  sources = [ "selector_fuzzer.cpp" ]
56  ldflags = [
57    "-fprofile-arcs",
58    "-ftest-coverage",
59    "--coverage",
60  ]
61  deps = [
62    "${THIRD_PARTY}/protobuf:protobuf_lite_static",
63    "${THIRD_PARTY}/protobuf:protobuf_static",
64    "../../../src:trace_streamer_source",
65    "../../../src/proto_reader:proto_reader",
66  ]
67}
68
69###############################################################################
70group("fuzztest") {
71  testonly = true
72  deps = []
73  deps += [
74    # deps file
75    ":ts_selector_fuzz_test",
76  ]
77}
78###############################################################################
79