aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core/util
diff options
context:
space:
mode:
authorGravatar Adele Zhou <adelez@google.com>2018-02-09 13:48:58 -0800
committerGravatar Adele Zhou <adelez@google.com>2018-02-12 21:51:44 -0800
commit0ad0e5d684b9e479798d4f3e59da354c39268a2a (patch)
tree9eb36842499d04eeaa629bacb9648a56a6339afd /test/core/util
parent1d168541fd55352be71116a8c8e5c9229b65b2b4 (diff)
Fix fuzzer tests for Bazel
Diffstat (limited to 'test/core/util')
-rw-r--r--test/core/util/fuzzer_corpus_test.cc7
-rw-r--r--test/core/util/grpc_fuzzer.bzl1
2 files changed, 8 insertions, 0 deletions
diff --git a/test/core/util/fuzzer_corpus_test.cc b/test/core/util/fuzzer_corpus_test.cc
index 7849321257..18bc0ad69e 100644
--- a/test/core/util/fuzzer_corpus_test.cc
+++ b/test/core/util/fuzzer_corpus_test.cc
@@ -25,6 +25,7 @@
#include <stdio.h>
#include <sys/types.h>
+#include "src/core/lib/gpr/env.h"
#include "src/core/lib/iomgr/load_file.h"
#include "test/core/util/test_config.h"
@@ -68,6 +69,12 @@ class ExampleGenerator
if (examples_.empty()) {
if (!FLAGS_file.empty()) examples_.push_back(FLAGS_file);
if (!FLAGS_directory.empty()) {
+ char* test_srcdir = gpr_getenv("TEST_SRCDIR");
+ if (test_srcdir != nullptr) {
+ FLAGS_directory = test_srcdir +
+ std::string("/com_github_grpc_grpc/") +
+ FLAGS_directory;
+ }
DIR* dp;
struct dirent* ep;
dp = opendir(FLAGS_directory.c_str());
diff --git a/test/core/util/grpc_fuzzer.bzl b/test/core/util/grpc_fuzzer.bzl
index b8b270ecd0..cece023fc0 100644
--- a/test/core/util/grpc_fuzzer.bzl
+++ b/test/core/util/grpc_fuzzer.bzl
@@ -23,5 +23,6 @@ def grpc_fuzzer(name, corpus, srcs = [], deps = [], **kwargs):
external_deps = [
'gtest',
],
+ args = ["--directory=" + native.package_name() + "/" + corpus,],
**kwargs
)