Skip to content

Commit

Permalink
x
Browse files Browse the repository at this point in the history
  • Loading branch information
ctiller committed Jan 24, 2025
1 parent f537413 commit f66bb08
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 45 deletions.
22 changes: 16 additions & 6 deletions test/core/promise/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
# See the License for the specific language governing permissions and
# limitations under the License.

load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_test", "grpc_package")
load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_proto_fuzzer")
load("//bazel:grpc_build_system.bzl", "grpc_cc_library", "grpc_cc_proto_library", "grpc_cc_test", "grpc_internal_proto_library", "grpc_package")
load("//test/core/test_util:grpc_fuzzer.bzl", "grpc_fuzz_test")
load("//test/cpp/microbenchmarks:grpc_benchmark_config.bzl", "HISTORY", "grpc_cc_benchmark")

licenses(["notice"])
Expand Down Expand Up @@ -521,18 +521,27 @@ grpc_cc_test(
],
)

grpc_proto_fuzzer(
grpc_internal_proto_library(
name = "promise_fuzzer_proto",
srcs = ["promise_fuzzer.proto"],
)

grpc_cc_proto_library(
name = "promise_fuzzer_cc_proto",
deps = ["promise_fuzzer_proto"],
)

grpc_fuzz_test(
name = "promise_fuzzer",
srcs = ["promise_fuzzer.cc"],
corpus = "promise_fuzzer_corpus",
external_deps = [
"absl/functional:any_invocable",
"absl/log:check",
"absl/status",
"fuzztest",
"fuzztest_main",
],
proto = "promise_fuzzer.proto",
tags = ["no_windows"],
uses_polling = False,
deps = [
"//:gpr",
"//:promise",
Expand All @@ -543,6 +552,7 @@ grpc_proto_fuzzer(
"//src/core:race",
"//src/core:seq",
"//test/core/test_util:grpc_test_util",
"promise_fuzzer_cc_proto",
],
)

Expand Down
11 changes: 5 additions & 6 deletions test/core/promise/promise_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
#include "absl/functional/any_invocable.h"
#include "absl/log/check.h"
#include "absl/status/status.h"
#include "fuzztest/fuzztest.h"
#include "src/core/lib/promise/activity.h"
#include "src/core/lib/promise/join.h"
#include "src/core/lib/promise/map.h"
#include "src/core/lib/promise/poll.h"
#include "src/core/lib/promise/promise.h"
#include "src/core/lib/promise/race.h"
#include "src/core/lib/promise/seq.h"
#include "src/libfuzzer/libfuzzer_macro.h"
#include "test/core/promise/promise_fuzzer.pb.h"

bool squelch = true;
Expand Down Expand Up @@ -329,10 +329,9 @@ class Fuzzer {
// Wakers that may be scheduled
std::map<int, std::vector<Waker>> wakers_;
};
} // namespace

} // namespace grpc_core
void Run(promise_fuzzer::Msg msg) { Fuzzer().Run(msg); }
FUZZ_TEST(PromiseFuzzer, Run);

DEFINE_PROTO_FUZZER(const promise_fuzzer::Msg& msg) {
grpc_core::Fuzzer().Run(msg);
}
} // namespace
} // namespace grpc_core

This file was deleted.

This file was deleted.

This file was deleted.

0 comments on commit f66bb08

Please sign in to comment.