Skip to content
suit Artifact [70d026ebdf]
Login

Artifact [70d026ebdf]

Artifact 70d026ebdf6bc3584bad577ba11a6a640f3d2a09ad4868053eb7b8b0ead8ced7:


#!/bin/sh
# One suite, three ways in a row, against the dev build (make quick rebuilds it first): as it is,
# with USER and LOGNAME unset, and under umask 027. Prints the three summary
# lines. The first thing to run after touching a suite; the full logs are
# build/quick-SUITE-WAY.log.
# usage: quick.sh unit|run|store|place|project|usage|curate|curate_apply
set -u
suite=${1:-}
case $suite in
    unit|run|store|place|project|usage|curate|curate_apply) ;;
    *) echo "usage: make quick SUITE=unit|run|store|place|project|usage|curate|curate_apply" >&2; exit 2 ;;
esac
for f in build/dev/suit build/dev/unit; do
    [ -x "$f" ] || { echo "quick: $f is missing; run make first" >&2; exit 1; }
done
export ASAN_OPTIONS=detect_leaks=0
status=0
for way in normal nouser umask; do
    log=build/quick-$suite-$way.log
    case $way in
        normal) sh tools/suites.sh build/dev "$suite" ;;
        nouser) env -u USER -u LOGNAME sh tools/suites.sh build/dev "$suite" ;;
        umask) (umask 027; sh tools/suites.sh build/dev "$suite") ;;
    esac >"$log" 2>&1 || status=1
    grep '^skip ' "$log" | sed "s/^/$way: /"
    printf '%s: ' "$way"
    grep -E '^(unit: [0-9]+ checks|[a-z_]+\.sh: [0-9]+ cases), [0-9]+ failed$' "$log" || { echo "no summary line ($log)"; status=1; }
done
exit $status