#!/bin/sh set -e types="debug release coverage" mkdir -p build cd build for type in $types do rm -rf $type mkdir -p $type cd $type case $type in debug) CFLAGS="-O0 -g3 -fsanitize=address,undefined" LDFLAGS="" OTHER="" ;; coverage) CFLAGS="-O0 -g3 --coverage -fcondition-coverage" LDFLAGS="" OTHER="--disable-shared" ;; release) CFLAGS="-O3 -flto" LDFLAGS="-flto" OTHER="" ;; *) echo "Unsupported type" exit 1 ;; esac ../../configure --enable-maintainer-mode --disable-shared --enable-build-mode=$type CFLAGS="$CFLAGS -Wall -Wextra -Werror -std=c89 -pedantic" LDFLAGS="$LDFLAGS" $OTHER make -j check ../../configure --enable-maintainer-mode --disable-shared --enable-build-mode=$type CFLAGS="$CFLAGS" LDFLAGS="$LDFLAGS" $OTHER cd .. done cd .. fossil ls | entr -c tools/tests $types