echo $valgrind
fi
+diff_prog="diff"
+if test -n "${wine}"
+then
+ # ignore whitespace at the end of line
+ diff_prog="${diff_prog} -b"
+fi
+
run_pack() {
local log="$1"
shift 1
local switches="$switches -W"
local cmd="${valgrind} ${wine} ${re2c} $switches $x"
- if test -n "${wine}"
- then
- local filter_newlines='-e s/\r//g'
- fi
- $cmd 2>&1 | LC_ALL=C sed -e "s,$x,`basename $x`,g" -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g' ${filter_newlines} > $outname
+ local outname_stdout="${outname}.stdout"
+ local outname_stderr="${outname}.stderr"
+ $cmd 2>$outname_stderr >$outname_stdout
+ cat $outname_stderr > $outname && rm $outname_stderr
+ cat $outname_stdout >> $outname && rm $outname_stdout
+ LC_ALL=C sed -i $outname \
+ -e "s,$x,`basename $x`,g" \
+ -e 's,/\* Generated by re2c .*\*/,/\* Generated by re2c \*/,g'
if test -n "$genname"
then
cat $genname | sed \
local errcnt=$(($errcnt + 1))
cp -f $x $test_blddir
else
- local r=`diff ${x%.re}.c $outname > $outdiff; echo $?`
+ local r=`$diff_prog ${x%.re}.c $outname > $outdiff; echo $?`
if [[ $r == 0 ]]
then
echo "OK $x: $switches"
echo "FAIL missing ${x%.re}.h"
local errcnt=$(($errcnt + 1))
cp -f $x $test_blddir
- elif diff ${x%.re}.h $typname > $typdiff
+ elif $diff_prog ${x%.re}.h $typname > $typdiff
then
echo "OK $x: $switches"
rm $typname