summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2018-08-23 19:21:16 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2018-08-23 19:21:16 (GMT)
commitd9d78f705ed2311737a127f985c6e4c81e2be58e (patch)
tree7781945e1e5fd33f2dcea40547af8618cf7d1a9e
parent0651432031c7525f05ab1700619250cfb6d15db1 (diff)
downloadhdf5-d9d78f705ed2311737a127f985c6e4c81e2be58e.zip
hdf5-d9d78f705ed2311737a127f985c6e4c81e2be58e.tar.gz
hdf5-d9d78f705ed2311737a127f985c6e4c81e2be58e.tar.bz2
Only remove test jars
-rw-r--r--java/test/junit.sh.in37
1 files changed, 33 insertions, 4 deletions
diff --git a/java/test/junit.sh.in b/java/test/junit.sh.in
index 21025c7..4f76d4e 100644
--- a/java/test/junit.sh.in
+++ b/java/test/junit.sh.in
@@ -59,11 +59,13 @@ LIST_LIBRARY_FILES="
$top_builddir/src/.libs/libhdf5.*
$top_builddir/java/src/jni/.libs/libhdf5_java.*
"
-LIST_JAR_FILES="
+LIST_JAR_TESTFILES="
$HDFLIB_HOME/hamcrest-core.jar
$HDFLIB_HOME/junit.jar
-$HDFLIB_HOME/slf4j-api-1.7.25.jar
-$HDFLIB_HOME/ext/slf4j-simple-1.7.25.jar
+$HDFLIB_HOME/slf4j-api-1.7.5.jar
+$HDFLIB_HOME/ext/slf4j-simple-1.7.5.jar
+"
+LIST_JAR_FILES="
$top_builddir/java/src/$JARFILE
"
LIST_DATA_FILES="
@@ -109,6 +111,7 @@ $HDFTEST_HOME/testfiles/JUnit-TestH5Giterate.txt
# copy files from source dirs to test dir
#
COPY_LIBFILES="$LIST_LIBRARY_FILES"
+COPY_JARTESTFILES="$LIST_JAR_TESTFILES"
COPY_JARFILES="$LIST_JAR_FILES"
COPY_LIBFILES_TO_BLDLIBDIR()
@@ -138,6 +141,29 @@ COPY_LIBFILES_TO_BLDLIBDIR()
fi
done
# copy jar files. Used -f to make sure get a new copy
+ for tstfile in $COPY_JARTESTFILES
+ do
+ # ignore '#' comment
+ echo $tstfile | tr -d ' ' | grep '^#' > /dev/null
+ RET=$?
+ if [ $RET -eq 1 ]; then
+ # skip cp if srcdir is same as destdir
+ # this occurs when build/test performed in source dir and
+ # make cp fail
+ SDIR=`$DIRNAME $tstfile`
+ INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
+ INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
+ if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
+ $CP -f $tstfile $BLDLIBDIR
+ if [ $? -ne 0 ]; then
+ echo "Error: FAILED to copy $tstfile ."
+
+ # Comment out this to CREATE expected file
+ exit $EXIT_FAILURE
+ fi
+ fi
+ fi
+ done
for tstfile in $COPY_JARFILES
do
# ignore '#' comment
@@ -172,7 +198,10 @@ CLEAN_LIBFILES_AND_BLDLIBDIR()
INODE_SDIR=`$LS -i -d $SDIR | $AWK -F' ' '{print $1}'`
INODE_DDIR=`$LS -i -d $BLDLIBDIR | $AWK -F' ' '{print $1}'`
if [ "$INODE_SDIR" != "$INODE_DDIR" ]; then
- $RM $BLDLIBDIR
+ for tstfile in $COPY_JARTESTFILES
+ do
+ $RM $BLDLIBDIR/tstfile
+ done
fi
}