[MLton-commit] r4180
Stephen Weeks
MLton@mlton.org
Tue, 8 Nov 2005 18:02:04 -0800
Improved regression script for MinGW. For some reason, MinGW sed
doesn't do the right thing with \r, so I hardwired Cygwin sed for
now.
----------------------------------------------------------------------
U mlton/trunk/bin/regression
----------------------------------------------------------------------
Modified: mlton/trunk/bin/regression
===================================================================
--- mlton/trunk/bin/regression 2005-11-09 02:01:22 UTC (rev 4179)
+++ mlton/trunk/bin/regression 2005-11-09 02:02:01 UTC (rev 4180)
@@ -90,6 +90,16 @@
exit 0
fi
+forMinGW='false'
+if [ `host-os` = mingw ]; then
+ forMinGW='true'
+fi
+case $crossTarget in
+*mingw)
+ forMinGW='true'
+;;
+esac
+
for f in `ls *.sml`; do
f=`basename $f .sml`
case `host-os` in
@@ -174,23 +184,19 @@
esac
if [ ! -r $f.nonterm -a $cross = 'no' -a -x $f ]; then
nonZeroMsg='Nonzero exit status.'
- case $crossTarget in
- *mingw)
- nonZeroMsg="$nonZeroMsg"'\r'
- ;;
- esac
+ if $forMinGW; then
+ nonZeroMsg="$nonZeroMsg"'\r'
+ fi
( ./$f || echo -e "$nonZeroMsg" ) >$tmp 2>&1
if [ -r $f.ok ]; then
compare="$f.$HOST_ARCH-$HOST_OS.ok"
if [ ! -r $compare ]; then
compare="$f.ok"
fi
- case $crossTarget in
- *mingw)
+ if $forMinGW; then
compare="$f.sed.ok"
- sed 's/$/\r/' <"$f.ok" >"$compare"
- ;;
- esac
+ /c/cygwin/bin/sed 's/$/\r/' <"$f.ok" >"$compare"
+ fi
if ! diff $compare $tmp; then
echo "difference with $flags"
fi