Files
zeekay 00ad38069c build: wire desugar into Bazel + restore script execute bits
CI on the build-system-rebrand commit surfaced two gaps the rebrand agent
couldn't see (no Bazel on its host; it ran configure+make directly, not
super-test.sh):
- src/zap/BUILD.bazel: the zapc cc_library and the compiler cc_test glob never
  listed desugar.{c++,h}/desugar-test.c++, so module-loader.c++ failed with
  'undeclared inclusion of desugar.h'. Now wired (parity with Makefile.am+CMake).
- super-test.sh and 7 sibling scripts lost their +x bit in the rename churn →
  './super-test.sh: Permission denied' (exit 126). Restored.
2026-06-20 00:17:00 -07:00

73 lines
1.2 KiB
Bash
Executable File

#! /bin/bash
set -euo pipefail
echo "Choose test case:"
echo "1) TestAllTypes parsing"
echo "2) TestLists parsing"
echo "3) Canonicalization"
read -p "choice: " -n 1 TESTCASE
echo
case "$TESTCASE" in
1 )
TESTDATA=binary
FLAGS=
TESTNAME=default
;;
2 )
TESTDATA=lists.binary
FLAGS=--lists
TESTNAME=lists
;;
3 )
TESTDATA=binary
FLAGS=--canonicalize
TESTNAME=canonicalize
;;
* )
echo "Invalid choice: $TESTCASE" >&2
exit 1
esac
echo "Choose compiler:"
echo "1) GCC"
echo "2) Clang"
read -p "choice: " -n 1 TESTCASE
echo
case "$TESTCASE" in
1 )
export CXX=afl-g++
;;
2 )
export CXX=afl-clang++
;;
* )
echo "Invalid choice: $TESTCASE" >&2
exit 1
esac
if [ -e Makefile ]; then
if ! grep -q '^CXX *= *'"$CXX" Makefile; then
# Wrong compiler used.
make distclean
$(dirname $0)/configure --disable-shared
fi
else
$(dirname $0)/configure --disable-shared
fi
make -j$(nproc)
make -j$(nproc) zap-afl-testcase
NOW=$(date +%Y-%m-%d.%H-%M-%S).$TESTNAME.$CXX
mkdir afl.$NOW.inputs afl.$NOW.findings
cp $(dirname $0)/src/zap/testdata/$TESTDATA afl.$NOW.inputs
afl-fuzz -i afl.$NOW.inputs -o afl.$NOW.findings -- ./zap-afl-testcase $FLAGS