summaryrefslogtreecommitdiff
path: root/fuzz/fuzz.sh
diff options
context:
space:
mode:
Diffstat (limited to 'fuzz/fuzz.sh')
-rwxr-xr-xfuzz/fuzz.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/fuzz/fuzz.sh b/fuzz/fuzz.sh
new file mode 100755
index 0000000..65aab9c
--- /dev/null
+++ b/fuzz/fuzz.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+set -e
+
+case "$1" in
+ keymap|compose)
+ ;;
+ *)
+ echo "usage: $0 keymap|compose" 1>&2
+ exit 1
+ ;;
+esac
+
+export CC=afl-clang-fast
+export AFL_HARDEN=1
+test -d fuzz/build || meson setup -Db_lto=true fuzz/build
+ninja -C fuzz/build
+afl-fuzz -i fuzz/$1/testcases -x fuzz/$1/dict -o fuzz/$1/findings -t 200 -m 10 -- ./fuzz/build/fuzz-$1 @@