changeset 407:f29068bfeaed

6876755: apt tests fail on Windows Reviewed-by: darcy
author jjg
date Thu, 27 Aug 2009 17:50:21 -0700
parents 2c20f17c429c
children 477c5bf1149c
files test/tools/apt/Basics/apt.sh test/tools/apt/Basics/print.sh test/tools/apt/Compile/compile.sh
diffstat 3 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/apt/Basics/apt.sh	Thu Aug 27 17:39:16 2009 -0700
+++ b/test/tools/apt/Basics/apt.sh	Thu Aug 27 17:50:21 2009 -0700
@@ -33,12 +33,11 @@
 
 OS=`uname -s`;
 case "${OS}" in
-        Windows* | CYGWIN* )
-                SEP=";"
+        CYGWIN* )
+                DIFFOPTS="--strip-trailing-cr"
         ;;
 
 	* )
-	SEP=":"
 	;;
 esac
 
@@ -94,7 +93,7 @@
 do
 	printf "%s\n" "Testing annotations on source file ${i}"
 	${APT} @options ${i} 2> result.txt
-	diff ${TESTSRC}/golden.txt result.txt
+	diff ${DIFFOPTS} ${TESTSRC}/golden.txt result.txt
 
 	RESULT=$?
 	case "$RESULT" in
@@ -109,7 +108,7 @@
 	CLASS=`basename ${i} .java`
 	printf "%s\n" "Testing annotations on class file ${CLASS}"
 	${APT} @options1 ${CLASS} 2> result2.txt
-	diff ${TESTSRC}/golden.txt result2.txt
+	diff ${DIFFOPTS} ${TESTSRC}/golden.txt result2.txt
 
 	RESULT=$?
 	case "$RESULT" in
--- a/test/tools/apt/Basics/print.sh	Thu Aug 27 17:39:16 2009 -0700
+++ b/test/tools/apt/Basics/print.sh	Thu Aug 27 17:50:21 2009 -0700
@@ -32,12 +32,11 @@
 
 OS=`uname -s`;
 case "${OS}" in
-        Windows* | CYGWIN* )
-                SEP=";"
+        CYGWIN* )
+                DIFFOPTS="--strip-trailing-cr"
         ;;
 
 	* )
-	SEP=":"
 	;;
 esac
 
@@ -88,7 +87,7 @@
 # check for mutliple methods and no static initializer
 
 ${APT} -XclassesAsDecls -cp ${TESTCLASSES} -print Aggregate > aggregate.txt
-diff aggregate.txt ${TESTSRC}/goldenAggregate.txt
+diff ${DIFFOPTS} aggregate.txt ${TESTSRC}/goldenAggregate.txt
 
 RESULT=$?
 case "$RESULT" in
--- a/test/tools/apt/Compile/compile.sh	Thu Aug 27 17:39:16 2009 -0700
+++ b/test/tools/apt/Compile/compile.sh	Thu Aug 27 17:50:21 2009 -0700
@@ -57,7 +57,12 @@
 
 OS=`uname -s`;
 case "${OS}" in
-        Windows* | CYGWIN* )
+        Windows* )
+                SEP=";"
+        ;;
+
+        CYGWIN* )
+		DIFFOPTS="--strip-trailing-cr"
                 SEP=";"
         ;;
 
@@ -150,7 +155,7 @@
 
 TestNoFile "HelloWorld.class"
 
-diff output ${TESTSRC}/golden.txt
+diff ${DIFFOPTS} output ${TESTSRC}/golden.txt
 
 RESULT=$?
 case "$RESULT" in
@@ -180,7 +185,7 @@
 printf "%s\n" "HelloAnnotation.java"        >> options3
 ${APT} @options3 2> output
 
-diff output ${TESTSRC}/goldenWarn.txt
+diff ${DIFFOPTS} output ${TESTSRC}/goldenWarn.txt
 
 RESULT=$?
 case "$RESULT" in
@@ -485,7 +490,7 @@
 printf "%s\n" "${TESTSRC}/Dummy1.java" >> options8
 ${APT} @options8 > multiRoundOutput 2> multiRoundError
 
-diff multiRoundOutput  ${TESTSRC}/goldenFactory.txt
+diff ${DIFFOPTS} multiRoundOutput  ${TESTSRC}/goldenFactory.txt
 
 RESULT=$?
 case "$RESULT" in