summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2016-12-14 15:57:22 -0500
committerNick Mathewson <nickm@torproject.org>2017-01-30 08:37:24 -0500
commit3c748559343b98f1dd37a0f49bd1e179715bf511 (patch)
tree4e900717224654460f3603ca413745235bf58b75 /src
parent81e44c22573e86cdcca6e47a7e68b3c83d4855f1 (diff)
downloadtor-3c748559343b98f1dd37a0f49bd1e179715bf511.tar.gz
tor-3c748559343b98f1dd37a0f49bd1e179715bf511.zip
Addition to test cases: make sure fuzzer binaries allow known cases
This isn't fuzzing per se, so much as replaying the highlights of past fuzzer runs.
Diffstat (limited to 'src')
-rw-r--r--src/test/fuzz/include.am5
-rwxr-xr-xsrc/test/fuzz_static_testcases.sh15
-rw-r--r--src/test/include.am4
3 files changed, 21 insertions, 3 deletions
diff --git a/src/test/fuzz/include.am b/src/test/fuzz/include.am
index 7f413183f7..16e5d30d50 100644
--- a/src/test/fuzz/include.am
+++ b/src/test/fuzz/include.am
@@ -52,6 +52,7 @@ FUZZERS = \
src/test/fuzz/fuzz-extrainfo \
src/test/fuzz/fuzz-http
-# The fuzzers aren't built by default right now. That should change.
-EXTRA_PROGRAMS += $(FUZZERS)
+noinst_PROGRAMS += $(FUZZERS)
fuzzers: $(FUZZERS)
+
+
diff --git a/src/test/fuzz_static_testcases.sh b/src/test/fuzz_static_testcases.sh
new file mode 100755
index 0000000000..276bc6e157
--- /dev/null
+++ b/src/test/fuzz_static_testcases.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+# Copyright (c) 2016, The Tor Project, Inc.
+# See LICENSE for licensing information
+
+set -e
+
+for fuzzer in "${builddir:-.}"/src/test/fuzz/fuzz-* ; do
+ f=`basename $fuzzer`
+ case="${f#fuzz-}"
+ echo "Running tests for ${case}"
+ for entry in ${abs_top_srcdir:-.}/src/test/fuzz/data/${case}/*; do
+ "${fuzzer}" "--err" < "$entry"
+ done
+done
diff --git a/src/test/include.am b/src/test/include.am
index d406d6d324..9f30443496 100644
--- a/src/test/include.am
+++ b/src/test/include.am
@@ -8,7 +8,9 @@ TESTS_ENVIRONMENT = \
export builddir="$(builddir)"; \
export TESTING_TOR_BINARY="$(TESTING_TOR_BINARY)";
-TESTSCRIPTS = src/test/test_zero_length_keys.sh \
+TESTSCRIPTS = \
+ src/test/fuzz_static_testcases.sh \
+ src/test/test_zero_length_keys.sh \
src/test/test_workqueue_cancel.sh \
src/test/test_workqueue_efd.sh \
src/test/test_workqueue_efd2.sh \