Files
carbon-lang/explorer/fuzzing/BUILD
T
Jon Ross-Perkins d18c1347d7 Migrate compatible uses to TestRawOstream. (#2891)
Replacing direct raw_string_ostream uses. I figure the wrapper should be used more consistently.

There are still remaining raw_string_ostream uses that weren't compatible -- I'm continuing to look at those, but felt it was cleaner to have this on its own.
2023-06-14 09:31:56 -07:00

104 lines
2.7 KiB
Python

# Part of the Carbon Language project, under the Apache License v2.0 with LLVM
# Exceptions. See /LICENSE for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
load("//bazel/fuzzing:rules.bzl", "cc_fuzz_test")
cc_library(
name = "ast_to_proto_lib",
testonly = 1,
srcs = ["ast_to_proto.cpp"],
hdrs = ["ast_to_proto.h"],
deps = [
"//common/fuzzing:carbon_cc_proto",
"//explorer/ast",
"@llvm-project//llvm:Support",
],
)
cc_binary(
name = "ast_to_proto",
testonly = 1,
srcs = ["ast_to_proto_main.cpp"],
deps = [
":ast_to_proto_lib",
"//common:bazel_working_dir",
"//common:error",
"//common/fuzzing:carbon_cc_proto",
"//explorer/ast",
"//explorer/common:arena",
"//explorer/syntax",
"@com_google_protobuf//:protobuf_headers",
],
)
cc_test(
name = "ast_to_proto_test",
srcs = ["ast_to_proto_test.cpp"],
args = [
"$(locations //explorer:standard_libraries)",
"$(locations //explorer:carbon_files)",
],
data = [
"//explorer:carbon_files",
"//explorer:standard_libraries",
],
deps = [
":ast_to_proto_lib",
"//common/fuzzing:carbon_cc_proto",
"//common/fuzzing:proto_to_carbon_lib",
"//explorer/syntax",
"//testing/util:test_raw_ostream",
"@com_google_googletest//:gtest",
"@com_google_protobuf//:protobuf_headers",
],
)
cc_library(
name = "fuzzer_util",
testonly = 1,
srcs = ["fuzzer_util.cpp"],
hdrs = ["fuzzer_util.h"],
deps = [
"//common:check",
"//common:error",
"//common/fuzzing:carbon_cc_proto",
"//common/fuzzing:proto_to_carbon_lib",
"//explorer/ast",
"//explorer/parse_and_execute",
"@bazel_tools//tools/cpp/runfiles",
"@com_google_protobuf//:protobuf_headers",
"@llvm-project//llvm:Support",
],
)
cc_test(
name = "fuzzer_util_test",
srcs = ["fuzzer_util_test.cpp"],
data = [
"//explorer:standard_libraries",
],
deps = [
":fuzzer_util",
"//common/fuzzing:proto_to_carbon_lib",
"//testing/util:gtest_main",
"@com_google_googletest//:gtest",
"@com_google_protobuf//:protobuf_headers",
"@llvm-project//llvm:Support",
],
)
cc_fuzz_test(
name = "explorer_fuzzer",
testonly = 1,
srcs = ["explorer_fuzzer.cpp"],
corpus = glob(["fuzzer_corpus/*"]),
shard_count = 8,
deps = [
":fuzzer_util",
"//common:error",
"@com_google_libprotobuf_mutator//:libprotobuf_mutator",
"@llvm-project//llvm:Support",
],
)