changeset 387:477c5bf1149c

6876765: javah tests fail on Windows Reviewed-by: darcy
author jjg
date Thu, 27 Aug 2009 18:25:21 -0700
parents f29068bfeaed
children 0ba956343648
files test/tools/javah/6257087/foo.sh test/tools/javah/ConstMacroTest.sh test/tools/javah/MissingParamClassTest.sh test/tools/javah/ReadOldClass.sh
diffstat 4 files changed, 16 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/test/tools/javah/6257087/foo.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/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/test/tools/javah/ConstMacroTest.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/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/test/tools/javah/MissingParamClassTest.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/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/test/tools/javah/ReadOldClass.sh	Thu Aug 27 17:50:21 2009 -0700
+++ b/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="\\"
     ;;