Skip to content
This repository was archived by the owner on Jul 31, 2023. It is now read-only.

Commit df271c4

Browse files
authored
Add placeholder bazel fuzzer targets. (#322)
1 parent a5a44c4 commit df271c4

File tree

3 files changed

+77
-0
lines changed

3 files changed

+77
-0
lines changed

bazel/BUILD

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Copyright 2019, OpenCensus Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
licenses(["notice"]) # Apache 2.0
16+
17+
package(default_visibility = ["//:__subpackages__"])

bazel/cc_fuzz_target.bzl

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2019, OpenCensus Authors
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
"""
15+
Placeholder rule for fuzzing.
16+
17+
Currently, fuzzing is done using the CMake build system.
18+
Please refer to ../opencensus/doc/fuzzing.md
19+
"""
20+
21+
def cc_fuzz_target(name, srcs, corpus, deps):
22+
"""TODO: Implement."""
23+
pass

opencensus/trace/BUILD

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
# limitations under the License.
1717

1818
load("//opencensus:copts.bzl", "DEFAULT_COPTS", "TEST_COPTS")
19+
load("//bazel:cc_fuzz_target.bzl", "cc_fuzz_target")
1920

2021
licenses(["notice"]) # Apache 2.0
2122

@@ -499,3 +500,39 @@ cc_binary(
499500
"@com_github_google_benchmark//:benchmark",
500501
],
501502
)
503+
504+
# Fuzzers
505+
# ========================================================================= #
506+
507+
cc_fuzz_target(
508+
name = "cloud_trace_context_fuzzer",
509+
srcs = ["internal/cloud_trace_context_fuzzer.cc"],
510+
corpus = glob(["internal/cloud_trace_context_corpus/*"]),
511+
deps = [
512+
":cloud_trace_context",
513+
":span_context",
514+
"@com_google_absl//absl/strings",
515+
],
516+
)
517+
518+
cc_fuzz_target(
519+
name = "grpc_trace_bin_fuzzer",
520+
srcs = ["internal/grpc_trace_bin_fuzzer.cc"],
521+
corpus = glob(["internal/grpc_trace_bin_corpus/*"]),
522+
deps = [
523+
":grpc_trace_bin",
524+
":span_context",
525+
"@com_google_absl//absl/strings",
526+
],
527+
)
528+
529+
cc_fuzz_target(
530+
name = "trace_context_fuzzer",
531+
srcs = ["internal/trace_context_fuzzer.cc"],
532+
corpus = glob(["internal/trace_context_corpus/*"]),
533+
deps = [
534+
":span_context",
535+
":trace_context",
536+
"@com_google_absl//absl/strings",
537+
],
538+
)

0 commit comments

Comments
 (0)