1#!/bin/sh
2set -e
3
4case "$1" in
5    keymap|compose)
6        ;;
7    *)
8        echo "usage: $0 keymap|compose" 1>&2
9        exit 1
10        ;;
11esac
12
13export CC=afl-clang-fast
14export AFL_HARDEN=1
15test -d fuzz/build || meson setup -Db_lto=true fuzz/build
16ninja -C fuzz/build
17afl-fuzz -i fuzz/$1/testcases -x fuzz/$1/dict -o fuzz/$1/findings -t 200 -m 10 -- ./fuzz/build/fuzz-$1 @@
18