6876765: javah tests fail on Windows
authorjjg
Thu, 27 Aug 2009 18:25:21 -0700
changeset 3770 12d0e59df0fb
parent 3769 5fd6cfd5a9a0
child 3771 6e7b16ecca30
6876765: javah tests fail on Windows Reviewed-by: darcy
langtools/test/tools/javah/6257087/foo.sh
langtools/test/tools/javah/ConstMacroTest.sh
langtools/test/tools/javah/MissingParamClassTest.sh
langtools/test/tools/javah/ReadOldClass.sh
--- a/langtools/test/tools/javah/6257087/foo.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/langtools/test/tools/javah/6257087/foo.sh	Thu Aug 27 18:25:21 2009 -0700
@@ -42,12 +42,15 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
     PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    PS=":"
+    FS="/"
+    DIFFOPTS="--strip-trailing-cr"
+    ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     ;;
@@ -57,9 +60,9 @@
     ;;
 esac
 
-"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TC}" "${TS}${FS}foo.java" > ${NULL}
+"${TESTJAVA}${FS}bin${FS}javac" ${TESTTOOLVMOPTS} -d "${TC}" "${TS}${FS}foo.java" 
 "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} -classpath "${TC}" -d "${TC}" foo
-diff -c "${TS}${FS}foo_bar.h" "${TC}${FS}foo_bar.h"
+diff ${DIFFOPTS} -c "${TS}${FS}foo_bar.h" "${TC}${FS}foo_bar.h"
 result=$?
 
 if [ $result -eq 0 ]
--- a/langtools/test/tools/javah/ConstMacroTest.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/langtools/test/tools/javah/ConstMacroTest.sh	Thu Aug 27 18:25:21 2009 -0700
@@ -57,12 +57,16 @@
 OS=`uname -s`
 case "$OS" in
   SunOS | Linux )
-    NULL=/dev/null
     PS=":"
     FS="/"
     ;;
+  CYGWIN* )
+    PS=":"
+    FS="/"
+    DIFFOPTS="--strip-trailing-cr"
+    EXPECTED_JAVAH_OUT_FILE=SubClassConsts.win
+    ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     EXPECTED_JAVAH_OUT_FILE=SubClassConsts.win
@@ -85,7 +89,7 @@
 
 "${TESTJAVA}${FS}bin${FS}javah" ${TESTTOOLVMOPTS} SubClassConsts
 
-cmp  "${TESTSRC}${FS}${EXPECTED_JAVAH_OUT_FILE}" "${GENERATED_HEADER_FILE}"
+diff ${DIFFOPTS} "${TESTSRC}${FS}${EXPECTED_JAVAH_OUT_FILE}" "${GENERATED_HEADER_FILE}"
 result=$?
 rm ${GENERATED_HEADER_FILE}
 
--- a/langtools/test/tools/javah/MissingParamClassTest.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/langtools/test/tools/javah/MissingParamClassTest.sh	Thu Aug 27 18:25:21 2009 -0700
@@ -58,13 +58,11 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux )
-    NULL=/dev/null
+  SunOS | Linux | CYGWIN* )
     PS=":"
     FS="/"
     ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     ;;
--- a/langtools/test/tools/javah/ReadOldClass.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/langtools/test/tools/javah/ReadOldClass.sh	Thu Aug 27 18:25:21 2009 -0700
@@ -43,13 +43,11 @@
 # set platform-dependent variables
 OS=`uname -s`
 case "$OS" in
-  SunOS | Linux )
-    NULL=/dev/null
+  SunOS | Linux | CYGWIN* )
     PS=":"
     FS="/"
     ;;
   Windows* )
-    NULL=NUL
     PS=";"
     FS="\\"
     ;;