2 # This script is in the public domain
3 # POSIX shell solution for named pipes and pipestatus,
4 # http://shell.cfajohnson.com/cus-faq-2.html#Q11
7 # while eval "\${pipestatus_$j+:} false"; do
13 # if [ "x$a" = 'x|' ]; then
14 # com="$com { $l "'3>&-
15 # echo "pipestatus_'$j'=$?" >&3
23 # com="$com $l"' 3>&- >&4 4>&-
24 # echo "pipestatus_'$j'=$?"'
26 # eval "$(exec 3>&1; eval "$com")"
29 # while eval "\${pipestatus_$j+:} false"; do
30 # eval "[ \$pipestatus_$j -eq 0 ]" || return 1
36 # # https://mywiki.wooledge.org/Bashism has another solution:
37 # # mkfifo fifo; command2 <fifo & command1 >fifo; echo "$?"
40 if [ "$1" = "" ]; then
42 taskset 1 make check || break;
45 LOGFILE="test_`date "+%m.%d-%H:%M:%S"`.log"
46 taskset 01 $1 2>&1 | tee $LOGFILE | grep -v DEBUG;
47 # TODO: Replace $PIPESTATUS with more portable code
48 if [ "${PIPESTATUS[0]}" != "0" ]; then
54 grep cadet test_*.log | grep -B 10 ERROR && break
55 grep cadet test_*.log | grep -B 10 Assert && break
56 ls core* > /dev/null 2>&1 && break