chiark / gitweb /
regress: Provide fuzzcat.d
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 19 Nov 2016 19:30:02 +0000 (19:30 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 11 Jun 2020 15:13:02 +0000 (16:13 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
.gitignore
regress/Makefile.in
regress/categorizefuzz [new file with mode: 0755]
settings.make.in

index 4218eae1f9c62b1dc9f1f929b316069f60e33a02..81aee7a9162b8787763a39dee2e84ea951735aed 100644 (file)
@@ -29,6 +29,7 @@ client/adnsresfilter
 client/adnsresfilter_s
 dynamic/Makefile
 dynamic/libadns.so.*
+regress/fuzzcat.d
 regress/Makefile
 regress/*_record
 regress/*_playback
index 3c5252f3fecda9b3dea4dfd72c0e38062016010c..5f87f241296283a0ee23f982b4a2ae999a4683b0 100644 (file)
@@ -59,6 +59,9 @@ checkfuzz:    $(TARGETS) $(addprefix checkfuzz-,$(ALL_TESTS))
 # this target is mostly useful as prep work for running the fuzzer;
 # it doesn't really test any of adns
 
+fuzzcat.d:     checkfuzz
+               $(srcdir)/categorizefuzz $(ALL_TESTS)
+
 check-%:       case-%.sys
                @srcdir=$(srcdir) $(srcdir)/r1test $* || test $$? = 5
 
diff --git a/regress/categorizefuzz b/regress/categorizefuzz
new file mode 100755 (executable)
index 0000000..5a6a623
--- /dev/null
@@ -0,0 +1,18 @@
+#!/bin/sh
+set -e
+
+out=fuzzcat.d
+
+rm -rf "$out"
+mkdir "$out"
+
+for case in "$@"; do
+       fuzz="fuzz-$case"
+       exec <"$fuzz"
+       read nargs
+       read arg0len
+       read program
+       program="${program##*/}"
+       mkdir -p "$out/$program"
+       ln "$fuzz" "$out/$program"/.
+done
index 3b1e4bd060891710acc00f5032f731edccade1c7..d69c8afc2be89f567ff3fa1bb347aa83496877e8 100644 (file)
@@ -29,7 +29,7 @@ clean mostlyclean:
                rm -f $(TARGETS) $(AUTOCSRCS) $(AUTOCHDRS)
                rm -f *.o *.tmp* *.so *.so.* pipe.*
                rm -f output-*.err output-*.leftover
-               rm -f output-*.out output-*.report fuzz-*
+               rm -f output-*.out output-*.report fuzz-* fuzzcat.d
 
 distclean:             clean
                rm -f *~ ./#*# core *.orig *.rej Makefile config.h