Permalink
Browse files

Tests: Allow test harness to handle odd spaces

Cray compiler seems to like to add extra spaces. Ignore them.
  • Loading branch information...
1 parent a237406 commit 553ddd3cdfe1d373c46389924e187806eb54e330 @andreww committed Dec 22, 2011
Showing with 16 additions and 10 deletions.
  1. +2 −2 common/test/test.sh
  2. +7 −4 utils/test/test.sh
  3. +7 −4 wkml/test/test.sh
View
@@ -14,7 +14,7 @@ if ! make $1.exe; then
echo Cannot compile $1 >> failed.out
echo "------------" >> failed.out
else
- ./$1.exe 2>&1 | tr -d '\15' > test.out
+ ./$1.exe 2>&1 | tr -d '\15' | grep -v 'STOP' > test.out
if test -f $1.xml
then
tr -d '\15' < test.xml | grep -v UUID > test.xml.tmp; mv test.xml.tmp test.xml
@@ -41,7 +41,7 @@ else
# to check both directions as the "test_input" file reports
# errors in a non-standard way (by adding lines).
# FIXME: Better to correct test_input?
- if diff test.out $1.out | grep "^[><]" > /dev/null; then
+ if diff -B -b test.out $1.out | grep "^[><]" > /dev/null; then
echo $1 >> failed.out
echo "------------" >> failed.out
diff -u test.out $1.out >> failed.out
View
@@ -14,7 +14,7 @@ if ! make $1.exe; then
echo Cannot compile $1 >> failed.out
echo "------------" >> failed.out
else
- ./$1.exe 2>&1 | tr -d '\15' > test.out
+ ./$1.exe 2>&1 | tr -d '\15' | grep -v 'STOP' > test.out
if test -f $1.xml
then
tr -d '\15' < test.xml | grep -v UUID > test.xml.tmp; mv test.xml.tmp test.xml
@@ -36,9 +36,12 @@ else
fi
elif test -f $1.out
then
- # Note below that we don't do a direct grep; we just check
- # that the only DIFFerences are in one direction.
- if diff test.out $1.out | grep "^>" > /dev/null; then
+ # Note that for most of the test.sh files we only check
+ # that the DIFFerences are in one direction. Here, we need
+ # to check both directions as the "test_input" file reports
+ # errors in a non-standard way (by adding lines).
+ # FIXME: Better to correct test_input?
+ if diff -B -b test.out $1.out | grep "^[><]" > /dev/null; then
echo $1 >> failed.out
echo "------------" >> failed.out
diff -u test.out $1.out >> failed.out
View
@@ -14,7 +14,7 @@ if ! make $1.exe; then
echo Cannot compile $1 >> failed.out
echo "------------" >> failed.out
else
- ./$1.exe 2>&1 | tr -d '\15' > test.out
+ ./$1.exe 2>&1 | tr -d '\15' | grep -v 'STOP' > test.out
if test -f $1.xml
then
tr -d '\15' < test.xml | grep -v UUID > test.xml.tmp; mv test.xml.tmp test.xml
@@ -36,9 +36,12 @@ else
fi
elif test -f $1.out
then
- # Note below that we don't do a direct grep; we just check
- # that the only DIFFerences are in one direction.
- if diff test.out $1.out | grep "^>" > /dev/null; then
+ # Note that for most of the test.sh files we only check
+ # that the DIFFerences are in one direction. Here, we need
+ # to check both directions as the "test_input" file reports
+ # errors in a non-standard way (by adding lines).
+ # FIXME: Better to correct test_input?
+ if diff -B test.out $1.out | grep "^[><]" > /dev/null; then
echo $1 >> failed.out
echo "------------" >> failed.out
diff -u test.out $1.out >> failed.out

0 comments on commit 553ddd3

Please sign in to comment.