[NCF-272]

There was a problem with the
distcheck testing since the test input files
are in ${src_dir} and the test is in ${build_dir}.
So modify run_chunk_hdf4 to copy as necessary.
This commit is contained in:
dmh 2014-05-31 13:54:52 -06:00
parent ff60798bb1
commit 4de1b58df2
4 changed files with 36 additions and 26 deletions

18
cf
View File

@ -21,16 +21,16 @@ CFLAGS=""
#CFLAGS="-Wall -Wno-unused-variable -Wno-unused-parameter ${CFLAGS}"
#CFLAGS="-Wconversion"
PREFIX=/usr/local
stddir="/usr/local"
if test "x$cmds" = x ; then
cmds=""
#cmds="all"
#cmds="all check"
#cmds="all dist"
#cmds="all distcheck"
#cmds="$cmds install"
PREFIX=/usr/local
if test "x${cmds}" = x ; then
cmds=""
else
for f in $cmds ; do
if test "x$f" = "xdistcheck" ; then
PREFIX=/tmp/$HOST
fi
done
fi
# HDF4=>HDF5

View File

@ -66,7 +66,7 @@ IF(USE_HDF4_FILE_TESTS)
add_sh_test(nc_test4 run_get_hdf4_files)
add_bin_test(nc_test4 tst_interops3)
add_sh_test(nc_test4 tst_formatx_hdf4)
add_bin_test(nc_test4 tst_chunk_hdf4)
build_bin_test(tst_chunk_hdf4)
add_sh_test(nc_test4 run_chunk_hdf4)
ENDIF()

View File

@ -1,11 +1,34 @@
#!/bin/sh
# Run test_chunk_hdf4 passing ${src_dir}
set -x
CHUNKED=chunked.hdf4
CONTIG=contiguous.hdf4
echo ""
echo "*** Testing hdf4 chunking..."
if ./tst_chunk_hdf4 ${src_dir} ; then
if test "x${src_dir}" = "x" ; then
src_dir="."
fi
# Move the data sets into place
ISDISTCHECK=0
if test -f ./${CHUNKED} ; then
ISDISTCHECK=0
else
ISDISTCHECK=1
cp ${src_dir}/${CHUNKED} .
cp ${src_dir}/${CONTIG} .
fi
if ./tst_chunk_hdf4 ; then
echo "***SUCCESS!! tst_chunk_hdf4"
else
echo "***FAIL: tst_chunk_hdf4"
fi
if test "x${ISDISTCHECK}" = "x1" ; then
echo rm -f ./${CHUNKED} ./${CONTIG}
fi
exit 0

View File

@ -32,20 +32,12 @@ main(int argc, char **argv)
int storage;
size_t chunksizes[NC_MAX_VAR_DIMS];
const char* srcdir = ".";
char* path;
if(argc > 1)
srcdir = argv[1];
printf("\n*** Testing HDF4/NetCDF-4 chunking API: chunked...\n");
{
path = (char*)malloc(sizeof(srcdir)+sizeof(CHUNKEDFILE)+2);
strcpy(path,srcdir);
strcat(path,"/");
strcat(path,CHUNKEDFILE);
/* Open with netCDF */
if (nc_open(path, NC_NOWRITE, &ncid)) ERR;
if (nc_open(CHUNKEDFILE, NC_NOWRITE, &ncid)) ERR;
/* Get a variable id */
if(nc_inq_varid(ncid,CHUNKEDVAR,&varid)) ERR;
@ -73,13 +65,8 @@ main(int argc, char **argv)
printf("\n*** Testing HDF4/NetCDF-4 chunking API: contiguous...\n");
{
path = (char*)malloc(sizeof(srcdir)+sizeof(CONTIGFILE)+2);
strcpy(path,srcdir);
strcat(path,"/");
strcat(path,CONTIGFILE);
/* Open with netCDF */
if (nc_open(path, NC_NOWRITE, &ncid)) ERR;
if (nc_open(CONTIGFILE, NC_NOWRITE, &ncid)) ERR;
/* Get a variable id */
if(nc_inq_varid(ncid,CONTIGVAR,&varid)) ERR;