summaryrefslogtreecommitdiffstats
path: root/java
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2016-03-15 17:13:41 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2016-03-15 17:13:41 (GMT)
commit5a344710ba8e08bfb2fe0851d81db23d0da5b964 (patch)
tree8fb286769b422ee0183ba67c34e0ce064aaaaa05 /java
parentf56bf61b8c5f97a0e4b98fbad35fa0206554e0cb (diff)
downloadhdf5-5a344710ba8e08bfb2fe0851d81db23d0da5b964.zip
hdf5-5a344710ba8e08bfb2fe0851d81db23d0da5b964.tar.gz
hdf5-5a344710ba8e08bfb2fe0851d81db23d0da5b964.tar.bz2
[svn-r29418] Add compare to expected to script to verify correct operation of test
Diffstat (limited to 'java')
-rw-r--r--java/test/junit.sh.in30
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