mirror of
https://github.com/HDFGroup/hdf5.git
synced 2026-09-25 04:09:44 +03:00
Add script to test examples with h5*cc pkg-config wrappers (#5486)
This commit is contained in:
@@ -10,14 +10,20 @@
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# This file is for use of h5cc created with the CMake process
|
||||
# HDF5_HOME is expected to be set
|
||||
# This file is for use of h5cc created with the CMake process.
|
||||
# Environment variable, HDF5_HOME is expected to be set.
|
||||
# $1 is the path name of the source directory.
|
||||
# $2 is the path name of the build directory.
|
||||
# $3 is the current path name.
|
||||
|
||||
srcdir=..
|
||||
builddir=.
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
currentpath=$3
|
||||
verbose=yes
|
||||
nerrors=0
|
||||
|
||||
echo "Current build directory: $top_builddir/$currentpath"
|
||||
|
||||
# HDF5 compile commands, assuming they are in your $PATH.
|
||||
H5CC=$HDF5_HOME/bin/h5cc
|
||||
LD_LIBRARY_PATH=$HDF5_HOME/lib
|
||||
@@ -52,7 +58,7 @@ AWK='awk'
|
||||
# setup plugin path
|
||||
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"
|
||||
|
||||
TESTDIR=$builddir
|
||||
TESTDIR=$top_builddir/$currentpath
|
||||
|
||||
|
||||
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
|
||||
@@ -65,11 +71,18 @@ ECHO_N="echo $ECHO_N"
|
||||
|
||||
|
||||
exout() {
|
||||
$*
|
||||
cd $TESTDIR
|
||||
"$@"
|
||||
}
|
||||
|
||||
dumpout() {
|
||||
$H5DUMP $*
|
||||
cd $TESTDIR
|
||||
$H5DUMP "$@"
|
||||
}
|
||||
|
||||
compileout() {
|
||||
cd $TESTDIR
|
||||
$H5CC "$@"
|
||||
}
|
||||
|
||||
# compare current version, required version.
|
||||
@@ -102,29 +115,29 @@ rm -f h5ex_d_extern.data
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
|
||||
compileout $top_srcdir/$currentpath/$dir16/h5ex_d_$topic.c -o h5ex_d_$topic
|
||||
done
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
fname=h5ex_d_$topic
|
||||
$ECHO_N "Testing C/H5D/$fname...$ECHO_C"
|
||||
exout .$dir16/$fname >tmp.test
|
||||
exout ./$fname >tmp.test
|
||||
status=$?
|
||||
if test $status -eq 1
|
||||
then
|
||||
echo " Unsupported feature"
|
||||
status=0
|
||||
else
|
||||
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
cmp -s tmp.test $srcdir/tfiles/16/$fname.ddl
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -159,7 +172,7 @@ fi
|
||||
|
||||
for topic in $topics18
|
||||
do
|
||||
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
|
||||
compileout $top_srcdir/$currentpath/h5ex_d_$topic.c -o h5ex_d_$topic
|
||||
done
|
||||
|
||||
for topic in $topics18
|
||||
@@ -173,11 +186,9 @@ do
|
||||
echo " Unsupported feature"
|
||||
status=0
|
||||
else
|
||||
if [[ $fname == "h5ex_d_nbit" ]]
|
||||
then
|
||||
if [ "$fname" = "h5ex_d_nbit" ]; then
|
||||
tdir=$nbitdir
|
||||
if [[ $USE_ALT == "" ]]
|
||||
then
|
||||
if [ "$USE_ALT" = "" ]; then
|
||||
### set USE_ALT=07 if not set above
|
||||
USE_ALT="07"
|
||||
fi
|
||||
@@ -186,21 +197,20 @@ do
|
||||
### unset USE_ALT for the other topics
|
||||
USE_ALT=""
|
||||
fi
|
||||
cmp -s tmp.test $srcdir/tfiles/18/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
if [[ $fname == "h5ex_d_transform" ]]
|
||||
then
|
||||
if [ "$fname" = "h5ex_d_transform" ]; then
|
||||
targ="-n"
|
||||
else
|
||||
targ=""
|
||||
fi
|
||||
dumpout $targ $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
cmp -s tmp.test $srcdir/tfiles/$tdir/$fname$USE_ALT.ddl
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/$tdir/$fname$USE_ALT.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -215,7 +225,7 @@ done
|
||||
|
||||
|
||||
#Remove external data file from h5ex_d_extern
|
||||
rm -f h5ex_d_extern.data
|
||||
rm -f tmp.test
|
||||
rm -f $TESTDIR/h5ex_d_extern.data
|
||||
rm -f $TESTDIR/tmp.test
|
||||
echo "$return_val tests failed in C/H5D/"
|
||||
exit $return_val
|
||||
|
||||
@@ -10,14 +10,20 @@
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# This file is for use of h5cc created with the CMake process
|
||||
# HDF5_HOME is expected to be set
|
||||
# This file is for use of h5cc created with the CMake process.
|
||||
# Environment variable, HDF5_HOME is expected to be set.
|
||||
# $1 is the path name of the source directory.
|
||||
# $2 is the path name of the build directory.
|
||||
# $3 is the current path name.
|
||||
|
||||
srcdir=..
|
||||
builddir=.
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
currentpath=$3
|
||||
verbose=yes
|
||||
nerrors=0
|
||||
|
||||
echo "Current build directory: $top_builddir/$currentpath"
|
||||
|
||||
# HDF5 compile commands, assuming they are in your $PATH.
|
||||
H5CC=$HDF5_HOME/bin/h5cc
|
||||
LD_LIBRARY_PATH=$HDF5_HOME/lib
|
||||
@@ -52,7 +58,7 @@ AWK='awk'
|
||||
# setup plugin path
|
||||
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"
|
||||
|
||||
TESTDIR=$builddir
|
||||
TESTDIR=$top_builddir/$currentpath
|
||||
|
||||
|
||||
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
|
||||
@@ -65,20 +71,29 @@ ECHO_N="echo $ECHO_N"
|
||||
|
||||
|
||||
exout() {
|
||||
$*
|
||||
cd $TESTDIR
|
||||
"$@"
|
||||
}
|
||||
|
||||
dumpout() {
|
||||
$H5DUMP $*
|
||||
cd $TESTDIR
|
||||
$H5DUMP "$@"
|
||||
}
|
||||
|
||||
$H5CC $srcdir/h5ex_g_create.c -o h5ex_g_create
|
||||
compileout() {
|
||||
cd $TESTDIR
|
||||
$H5CC "$@"
|
||||
}
|
||||
|
||||
return_val=0
|
||||
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_create.c -o h5ex_g_create
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_create...$ECHO_C"
|
||||
./h5ex_g_create
|
||||
exout ./h5ex_g_create
|
||||
dumpout h5ex_g_create.h5 >tmp.test
|
||||
rm -f h5ex_g_create.h5
|
||||
cmp -s tmp.test $srcdir/tfiles/16/h5ex_g_create.ddl
|
||||
rm -f $TESTDIR/h5ex_g_create.h5
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/h5ex_g_create.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -88,18 +103,18 @@ else
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
|
||||
$H5CC $srcdir/h5ex_g_iterate.c -o h5ex_g_iterate
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_iterate.c -o h5ex_g_iterate
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_iterate...$ECHO_C"
|
||||
if test -f h5ex_g_iterate.h5
|
||||
if test -f $TESTDIR/h5ex_g_iterate.h5
|
||||
then
|
||||
exout ./h5ex_g_iterate >tmp.test
|
||||
else
|
||||
cp $srcdir/h5ex_g_iterate.h5 h5ex_g_iterate.h5
|
||||
cp $top_srcdir/$currentpath/h5ex_g_iterate.h5 $TESTDIR/h5ex_g_iterate.h5
|
||||
exout ./h5ex_g_iterate >tmp.test
|
||||
rm -f h5ex_g_iterate.h5
|
||||
rm -f $TESTDIR/h5ex_g_iterate.h5
|
||||
fi
|
||||
cmp -s tmp.test $srcdir/tfiles/16/h5ex_g_iterate.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/h5ex_g_iterate.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -109,18 +124,18 @@ else
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
|
||||
$H5CC $srcdir/h5ex_g_traverse.c -o h5ex_g_traverse
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_traverse.c -o h5ex_g_traverse
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_traverse...$ECHO_C"
|
||||
if test -f h5ex_g_traverse.h5
|
||||
if test -f $TESTDIR/h5ex_g_traverse.h5
|
||||
then
|
||||
exout ./h5ex_g_traverse >tmp.test
|
||||
else
|
||||
cp $srcdir/h5ex_g_traverse.h5 h5ex_g_traverse.h5
|
||||
cp $top_srcdir/$currentpath/h5ex_g_traverse.h5 $TESTDIR/h5ex_g_traverse.h5
|
||||
exout ./h5ex_g_traverse >tmp.test
|
||||
rm -f h5ex_g_traverse.h5
|
||||
rm -f $TESTDIR/h5ex_g_traverse.h5
|
||||
fi
|
||||
cmp -s tmp.test $srcdir/tfiles/16/h5ex_g_traverse.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/h5ex_g_traverse.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -130,18 +145,18 @@ else
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
|
||||
$H5CC $srcdir/h5ex_g_visit.c -o h5ex_g_visit
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_visit.c -o h5ex_g_visit
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_visit...$ECHO_C"
|
||||
if test -f h5ex_g_visit.h5
|
||||
if test -f $TESTDIR/h5ex_g_visit.h5
|
||||
then
|
||||
exout ./h5ex_g_visit >tmp.test
|
||||
else
|
||||
cp $srcdir/h5ex_g_visit.h5 h5ex_g_visit.h5
|
||||
cp $top_srcdir/$currentpath/h5ex_g_visit.h5 $TESTDIR/h5ex_g_visit.h5
|
||||
exout ./h5ex_g_visit >tmp.test
|
||||
rm -f h5ex_g_visit.h5
|
||||
rm -f $TESTDIR/h5ex_g_visit.h5
|
||||
fi
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_visit.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_visit.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -151,25 +166,25 @@ else
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
|
||||
$H5CC $srcdir/h5ex_g_compact.c -o h5ex_g_compact
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_compact.c -o h5ex_g_compact
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_compact...$ECHO_C"
|
||||
exout ./h5ex_g_compact >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_compact.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_compact.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout h5ex_g_compact1.h5 >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_compact1.ddl
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_compact1.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout h5ex_g_compact2.h5 >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_compact2.ddl
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_compact2.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -180,14 +195,14 @@ else
|
||||
fi
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
rm -f h5ex_g_compact1.h5
|
||||
rm -f h5ex_g_compact2.h5
|
||||
rm -f $TESTDIR/h5ex_g_compact1.h5
|
||||
rm -f $TESTDIR/h5ex_g_compact2.h5
|
||||
|
||||
$H5CC $srcdir/h5ex_g_phase.c -o h5ex_g_phase
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_phase.c -o h5ex_g_phase
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_phase...$ECHO_C"
|
||||
exout ./h5ex_g_phase >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_phase.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_phase.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -196,13 +211,13 @@ else
|
||||
echo " Passed"
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
rm -f h5ex_g_phase.h5
|
||||
rm -f $TESTDIR/h5ex_g_phase.h5
|
||||
|
||||
$H5CC $srcdir/h5ex_g_corder.c -o h5ex_g_corder
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_corder.c -o h5ex_g_corder
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_corder...$ECHO_C"
|
||||
exout ./h5ex_g_corder >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_corder.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_corder.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -211,13 +226,13 @@ else
|
||||
echo " Passed"
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
rm -f h5ex_g_corder.h5
|
||||
rm -f $TESTDIR/h5ex_g_corder.h5
|
||||
|
||||
$H5CC $srcdir/h5ex_g_intermediate.c -o h5ex_g_intermediate
|
||||
compileout $top_srcdir/$currentpath/h5ex_g_intermediate.c -o h5ex_g_intermediate
|
||||
|
||||
$ECHO_N "Testing C/H5G/h5ex_g_intermediate...$ECHO_C"
|
||||
exout ./h5ex_g_intermediate >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/18/h5ex_g_intermediate.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/h5ex_g_intermediate.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -226,9 +241,9 @@ else
|
||||
echo " Passed"
|
||||
fi
|
||||
return_val=`expr $status + $return_val`
|
||||
rm -f h5ex_g_intermediate.h5
|
||||
rm -f $TESTDIR/h5ex_g_intermediate.h5
|
||||
|
||||
|
||||
rm -f tmp.test
|
||||
rm -f $TESTDIR/tmp.test
|
||||
echo "$return_val tests failed in C/H5G/"
|
||||
exit $return_val
|
||||
|
||||
@@ -10,14 +10,20 @@
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# This file is for use of h5cc created with the CMake process
|
||||
# HDF5_HOME is expected to be set
|
||||
# This file is for use of h5cc created with the CMake process.
|
||||
# Environment variable, HDF5_HOME is expected to be set.
|
||||
# $1 is the path name of the source directory.
|
||||
# $2 is the path name of the build directory.
|
||||
# $3 is the current path name.
|
||||
|
||||
srcdir=..
|
||||
builddir=.
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
currentpath=$3
|
||||
verbose=yes
|
||||
nerrors=0
|
||||
|
||||
echo "Current build directory: $top_builddir/$currentpath"
|
||||
|
||||
# HDF5 compile commands, assuming they are in your $PATH.
|
||||
H5CC=$HDF5_HOME/bin/h5cc
|
||||
LD_LIBRARY_PATH=$HDF5_HOME/lib
|
||||
@@ -52,7 +58,7 @@ AWK='awk'
|
||||
# setup plugin path
|
||||
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"
|
||||
|
||||
TESTDIR=$builddir
|
||||
TESTDIR=$top_builddir/$currentpath
|
||||
|
||||
|
||||
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
|
||||
@@ -65,11 +71,18 @@ ECHO_N="echo $ECHO_N"
|
||||
|
||||
|
||||
exout() {
|
||||
$*
|
||||
cd $TESTDIR
|
||||
"$@"
|
||||
}
|
||||
|
||||
dumpout() {
|
||||
$H5DUMP $*
|
||||
cd $TESTDIR
|
||||
$H5DUMP "$@"
|
||||
}
|
||||
|
||||
compileout() {
|
||||
cd $TESTDIR
|
||||
$H5CC "$@"
|
||||
}
|
||||
|
||||
# compare current version, required version.
|
||||
@@ -90,7 +103,7 @@ return_val=0
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
$H5CC $srcdir/h5ex_t_$topic.c -o h5ex_t_$topic
|
||||
compileout $top_srcdir/$currentpath/h5ex_t_$topic.c -o h5ex_t_$topic
|
||||
done
|
||||
|
||||
for topic in $topics
|
||||
@@ -98,21 +111,20 @@ do
|
||||
fname=h5ex_t_$topic
|
||||
$ECHO_N "Testing C/H5T/$fname...$ECHO_C"
|
||||
exout ./$fname >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
if [[ $fname == "h5ex_t_cpxcmpd" || $fname == "h5ex_t_cpxcmpdatt" ]]
|
||||
then
|
||||
if [ "$fname" = "h5ex_t_cpxcmpd" -o "$fname" = "h5ex_t_cpxcmpdatt" ]; then
|
||||
targ="-n"
|
||||
else
|
||||
targ=""
|
||||
fi
|
||||
dumpout $targ $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
cmp -s tmp.test $srcdir/tfiles/18/$fname.ddl
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/$fname.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -148,7 +160,7 @@ topics="objref objrefatt regref regrefatt"
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
$H5CC $srcdir/h5ex_t_$topic.c -o h5ex_t_$topic
|
||||
compileout $top_srcdir/$currentpath/h5ex_t_$topic.c -o h5ex_t_$topic
|
||||
done
|
||||
|
||||
for topic in $topics
|
||||
@@ -156,28 +168,28 @@ do
|
||||
fname=h5ex_t_$topic
|
||||
$ECHO_N "Testing C/H5T/$fname...$ECHO_C"
|
||||
exout ./$fname >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
version_compare "$H5_LIBVER" "1.10.0"
|
||||
if [ "$version_lt" = 1 ]; then
|
||||
cmp -s tmp.test $srcdir/tfiles/18/$fname$USE_ALT.ddl
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/$fname$USE_ALT.ddl
|
||||
else
|
||||
version_compare "$H5_LIBVER" "1.12.0"
|
||||
if [ "$version_lt" = 1 ]; then
|
||||
version_compare "$H5_LIBVER" "1.10.7"
|
||||
if [ "$version_lt" = 1 ]; then
|
||||
cmp -s tmp.test $srcdir/tfiles/110/$fname$USE_ALT.ddl
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/110/$fname$USE_ALT.ddl
|
||||
else
|
||||
cmp -s tmp.test $srcdir/tfiles/18/$fname.ddl
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/18/$fname.ddl
|
||||
fi
|
||||
else
|
||||
cmp -s tmp.test $srcdir/tfiles/112/$fname.ddl
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/112/$fname.ddl
|
||||
fi
|
||||
fi
|
||||
status=$?
|
||||
@@ -195,7 +207,7 @@ topics="vlen vlenatt"
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
$H5CC $srcdir/h5ex_t_$topic.c -o h5ex_t_$topic
|
||||
compileout $top_srcdir/$currentpath/h5ex_t_$topic.c -o h5ex_t_$topic
|
||||
done
|
||||
|
||||
for topic in $topics
|
||||
@@ -203,19 +215,19 @@ do
|
||||
fname=h5ex_t_$topic
|
||||
$ECHO_N "Testing C/H5T/$fname...$ECHO_C"
|
||||
exout ./$fname >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
version_compare "$H5_LIBVER" "1.14.3"
|
||||
if [ "$version_lt" = 1 ]; then
|
||||
cmp -s tmp.test $srcdir/tfiles/18/$fname.ddl
|
||||
cmp -s tmp.test $top_srcdir/$currentpath/tfiles/18/$fname.ddl
|
||||
else
|
||||
cmp -s tmp.test $srcdir/tfiles/114/$fname.ddl
|
||||
cmp -s tmp.test $top_srcdir/$currentpath/tfiles/114/$fname.ddl
|
||||
fi
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
@@ -228,12 +240,12 @@ do
|
||||
return_val=`expr $status + $return_val`
|
||||
done
|
||||
|
||||
$H5CC $srcdir/h5ex_t_convert.c -o h5ex_t_convert
|
||||
compileout $top_srcdir/$currentpath/h5ex_t_convert.c -o h5ex_t_convert
|
||||
|
||||
fname=h5ex_t_convert
|
||||
$ECHO_N "Testing C/H5T/$fname...$ECHO_C"
|
||||
exout ./$fname >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/16/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/16/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -244,6 +256,6 @@ fi
|
||||
return_val=`expr $status + $return_val`
|
||||
|
||||
|
||||
rm -f tmp.test
|
||||
rm -f $TESTDIR/tmp.test
|
||||
echo "$return_val tests failed in C/H5T/"
|
||||
exit $return_val
|
||||
|
||||
Regular → Executable
+27
-14
@@ -10,14 +10,20 @@
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# This file is for use of h5cc created with the CMake process
|
||||
# HDF5_HOME is expected to be set
|
||||
# This file is for use of h5cc created with the CMake process.
|
||||
# Environment variable, HDF5_HOME is expected to be set.
|
||||
# $1 is the path name of the source directory.
|
||||
# $2 is the path name of the build directory.
|
||||
# $3 is the current path name.
|
||||
|
||||
srcdir=..
|
||||
builddir=.
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
currentpath=$3
|
||||
verbose=yes
|
||||
nerrors=0
|
||||
|
||||
echo "Current build directory: $top_builddir/$currentpath"
|
||||
|
||||
# HDF5 compile commands, assuming they are in your $PATH.
|
||||
H5CC=$HDF5_HOME/bin/h5cc
|
||||
LD_LIBRARY_PATH=$HDF5_HOME/lib
|
||||
@@ -52,7 +58,7 @@ AWK='awk'
|
||||
# setup plugin path
|
||||
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"
|
||||
|
||||
TESTDIR=$builddir
|
||||
TESTDIR=$top_builddir/$currentpath
|
||||
|
||||
|
||||
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
|
||||
@@ -65,11 +71,18 @@ ECHO_N="echo $ECHO_N"
|
||||
|
||||
|
||||
exout() {
|
||||
$*
|
||||
cd $TESTDIR
|
||||
"$@"
|
||||
}
|
||||
|
||||
dumpout() {
|
||||
$H5DUMP $*
|
||||
cd $TESTDIR
|
||||
$H5DUMP "$@"
|
||||
}
|
||||
|
||||
compileout() {
|
||||
cd $TESTDIR
|
||||
$H5CC "$@"
|
||||
}
|
||||
|
||||
# compare current version, required version.
|
||||
@@ -83,15 +96,15 @@ version_compare() {
|
||||
|
||||
|
||||
topics=""
|
||||
topics110="vds vds-exc vds-exclim vds-eiger vds-simpleIO vds-percival vds-percival-unlim vds-percival-unlim-maxmin"
|
||||
|
||||
topics110="vds vds-exc vds-eiger vds-simpleIO vds-percival vds-percival-unlim vds-percival-unlim-maxmin"
|
||||
# not tested vds-exclim
|
||||
return_val=0
|
||||
|
||||
version_compare "$H5_LIBVER" "1.10.0"
|
||||
if [ "$version_lt" = 0 ]; then
|
||||
for topic in $topics110
|
||||
do
|
||||
$H5CC $srcdir/h5ex_d_$topic.c -o h5ex_d_$topic
|
||||
compileout $top_srcdir/$currentpath/h5ex_$topic.c -o h5ex_$topic
|
||||
done
|
||||
|
||||
for topic in $topics110
|
||||
@@ -105,15 +118,15 @@ if [ "$version_lt" = 0 ]; then
|
||||
echo " Unsupported feature"
|
||||
status=0
|
||||
else
|
||||
cmp -s tmp.test $srcdir/tfiles/110/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/110/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
cmp -s tmp.test $srcdir/tfiles/110/$fname.ddl
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/110/$fname.ddl
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -128,6 +141,6 @@ if [ "$version_lt" = 0 ]; then
|
||||
fi
|
||||
|
||||
|
||||
rm -f tmp.test
|
||||
rm -f $TESTDIR/tmp.test
|
||||
echo "$return_val tests failed in C/H5VDS/"
|
||||
exit $return_val
|
||||
|
||||
@@ -10,14 +10,20 @@
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# This file is for use of h5cc created with the CMake process
|
||||
# HDF5_HOME is expected to be set
|
||||
# This file is for use of h5cc created with the CMake process.
|
||||
# Environment variable, HDF5_HOME is expected to be set.
|
||||
# $1 is the path name of the source directory.
|
||||
# $2 is the path name of the build directory.
|
||||
# $3 is the current path name.
|
||||
|
||||
srcdir=..
|
||||
builddir=.
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
currentpath=$3
|
||||
verbose=yes
|
||||
nerrors=0
|
||||
|
||||
echo "Current build directory: $top_builddir/$currentpath"
|
||||
|
||||
# HDF5 compile commands, assuming they are in your $PATH.
|
||||
H5CC=$HDF5_HOME/bin/h5cc
|
||||
LD_LIBRARY_PATH=$HDF5_HOME/lib
|
||||
@@ -52,7 +58,7 @@ AWK='awk'
|
||||
# setup plugin path
|
||||
ENVCMD="env HDF5_PLUGIN_PATH=$LD_LIBRARY_PATH/plugin"
|
||||
|
||||
TESTDIR=$builddir
|
||||
TESTDIR=$top_builddir/$currentpath
|
||||
|
||||
|
||||
case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in
|
||||
@@ -65,11 +71,18 @@ ECHO_N="echo $ECHO_N"
|
||||
|
||||
|
||||
exout() {
|
||||
$*
|
||||
cd $TESTDIR
|
||||
"$@"
|
||||
}
|
||||
|
||||
dumpout() {
|
||||
$H5DUMP $*
|
||||
cd $TESTDIR
|
||||
$H5DUMP "$@"
|
||||
}
|
||||
|
||||
compileout() {
|
||||
cd $TESTDIR
|
||||
$H5CC "$@"
|
||||
}
|
||||
|
||||
# compare current version, required version.
|
||||
@@ -81,7 +94,6 @@ version_compare() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
topics="h5ex_lite3 h5ex_packet_table_FL \
|
||||
h5ex_image1 h5ex_image2 \
|
||||
h5ex_table_01 h5ex_table_02 h5ex_table_03 h5ex_table_04 \
|
||||
@@ -93,23 +105,29 @@ return_val=0
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
$H5CC $srcdir/$topic.c -o $topic
|
||||
compileout $top_srcdir/$currentpath/$topic.c -o $topic
|
||||
done
|
||||
|
||||
# h5ex_image2 needs data files
|
||||
cp $top_srcdir/$currentpath/tfiles/image8.txt $TESTDIR/image8.txt
|
||||
cp $top_srcdir/$currentpath/tfiles/image24pixel.txt $TESTDIR/image24pixel.txt
|
||||
|
||||
for topic in $topics
|
||||
do
|
||||
fname=$topic
|
||||
$ECHO_N "Testing C/HL/$fname...$ECHO_C"
|
||||
exout ./$fname >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/$fname.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/$fname.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
echo " FAILED!"
|
||||
else
|
||||
dumpout $fname.h5 >tmp.test
|
||||
rm -f $fname.h5
|
||||
cmp -s tmp.test $srcdir/tfiles/$fname.ddl
|
||||
rm -f $TESTDIR/$fname.h5
|
||||
if [ !"$fname" = "h5ex_ds1" ]; then
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/$fname.ddl
|
||||
fi
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -122,12 +140,12 @@ do
|
||||
done
|
||||
|
||||
|
||||
$H5CC $srcdir/h5ex_lite1.c -o h5ex_lite1
|
||||
$H5CC $srcdir/h5ex_lite2.c -o h5ex_lite2
|
||||
compileout $top_srcdir/$currentpath/h5ex_lite1.c -o h5ex_lite1
|
||||
compileout $top_srcdir/$currentpath/h5ex_lite2.c -o h5ex_lite2
|
||||
|
||||
$ECHO_N "Testing C/HL/h5ex_lite1...$ECHO_C"
|
||||
exout ./h5ex_lite1 >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/h5ex_lite1.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/h5ex_lite1.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -135,7 +153,7 @@ then
|
||||
else
|
||||
$ECHO_N "Testing C/HL/h5ex_lite2...$ECHO_C"
|
||||
exout ./h5ex_lite2 >tmp.test
|
||||
cmp -s tmp.test $srcdir/tfiles/h5ex_lite2.tst
|
||||
cmp -s $TESTDIR/tmp.test $top_srcdir/$currentpath/tfiles/h5ex_lite2.tst
|
||||
status=$?
|
||||
if test $status -ne 0
|
||||
then
|
||||
@@ -147,6 +165,6 @@ fi
|
||||
return_val=`expr $status + $return_val`
|
||||
|
||||
|
||||
rm -f tmp.test
|
||||
rm -f $TESTDIR/tmp.test
|
||||
echo "$return_val tests failed in C/HL/"
|
||||
exit $return_val
|
||||
|
||||
Executable
+56
@@ -0,0 +1,56 @@
|
||||
#! /bin/sh
|
||||
#
|
||||
# Copyright by The HDF Group.
|
||||
# All rights reserved.
|
||||
#
|
||||
# This file is part of HDF5. The full HDF5 copyright notice, including
|
||||
# terms governing use, modification, and redistribution, is contained in
|
||||
# the LICENSE file, which can be found at the root of the source code
|
||||
# distribution tree, or in https://www.hdfgroup.org/licenses.
|
||||
# If you do not have access to either file, you may request a copy from
|
||||
# help@hdfgroup.org.
|
||||
|
||||
# This file is for use of h5cc created with the CMake process.
|
||||
# Environment variable, HDF5_HOME is expected to be set.
|
||||
# $1 is the path name of the source directory.
|
||||
# $2 is the path name of the build directory.
|
||||
# $3 is the current path name.
|
||||
|
||||
top_srcdir=$1
|
||||
top_builddir=$2
|
||||
currentpath=$3
|
||||
verbose=yes
|
||||
nerrors=0
|
||||
|
||||
return_val=0
|
||||
|
||||
echo "Current build directory: $top_builddir$currentpath"
|
||||
# Loop through all subdirectories
|
||||
for dir in */; do
|
||||
if [ -d "$dir" ] && [ ! -L "$dir" ]; then
|
||||
#check if test-pc.sh exists
|
||||
if [ -f "$dir/test-pc.sh" ];
|
||||
then
|
||||
echo "Entering directory: $dir"
|
||||
(
|
||||
mkdir "$top_builddir/$currentpath/$dir"
|
||||
cd "$dir"
|
||||
./test-pc.sh $top_srcdir $top_builddir $currentpath/$dir # Execute script in the subdirectory
|
||||
status=$?
|
||||
exit $status
|
||||
)
|
||||
return_val=$?
|
||||
if test $return_val -ne 0
|
||||
then
|
||||
echo "Exiting directory: $dir with $return_val tests FAILED"
|
||||
else
|
||||
echo "Exiting directory: $dir Passed"
|
||||
fi
|
||||
nerrors=`expr $return_val + $nerrors`
|
||||
fi
|
||||
fi
|
||||
done
|
||||
|
||||
echo "$nerrors tests failed in $currentpath"
|
||||
exit $nerrors
|
||||
|
||||
Reference in New Issue
Block a user