1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
#! /bin/sh # To use this script, set CC # and CFLAGS. set -e set -u t=$1 cat $t set -x if ! $CC $CFLAGS "$t" -o "$t.bin" then exit 1 fi if ! "$t.bin" > "$t.output" 2>&1 then exit 1 fi if ! diff -u "$t.expected" "$t.output" then exit 1 fi