diff options
-rw-r--r-- | java/test/junit.sh.in | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in index 6878b3b..9473911 100644 --- a/java/test/junit.sh.in +++ b/java/test/junit.sh.in @@ -61,8 +61,14 @@ $top_builddir/java/src/$JARFILE " LIST_DATA_FILES=" $HDFTEST_HOME/h5ex_g_iterate.hdf +$HDFTEST_HOME/JUnit-interface.txt " +expect="JUnit-interface.txt" +actual="JUnit-interface.out" +actual_err="JUnit-interface.err" +actual_ext="JUnit-interface.ext" + # # copy files from source dirs to test dir # @@ -150,6 +156,9 @@ CLEAN_DATAFILES_AND_BLDDIR() if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then $RM $BLDDIR/*.hdf $RM $BLDDIR/*.out + $RM $BLDDIR/*.err + $RM $BLDDIR/*.ext + $RM $BLDDIR/*.txt fi } @@ -218,7 +227,26 @@ esac export LD_LIBRARY_PATH echo "$JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll" -($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll) +($JAVAEXE $JAVAEXEFLAGS -Xmx1024M -Dorg.slf4j.simpleLogger.defaultLog=trace -Djava.library.path=$BLDLIBDIR -cp $CLASSPATH -ea org.junit.runner.JUnitCore test.TestAll 1>$actual_ext 2>$actual_err) + +# Extract file name, line number, version and thread IDs because they may be different +sed -e 's/thread [0-9]*/thread (IDs)/' -e 's/: .*\.c /: (file name) /' \ + -e 's/line [0-9]*/line (number)/' \ + -e 's/Time: [0-9]*\.[0-9]*/Time: XXXX/' \ + -e 's/v[1-9]*\.[0-9]*\./version (number)\./' \ + -e 's/[1-9]*\.[0-9]*\.[0-9]*[^)]*/version (number)/' \ + $actual_ext > $actual +cat $actual_err >> $actual + +if $CMP $expect $actual; then + echo " PASSED" +else + echo "*FAILED*" + echo " Expected result differs from actual result" + nerrors="`expr $nerrors + 1`" + test yes = "$verbose" && $DIFF $expect1 $actual |sed 's/^/ /' +fi + # Clean up temporary files/directories CLEAN_LIBFILES_AND_BLDLIBDIR |