From e064855a102713f85358c1263a99a1595b59436d Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Sat, 25 Nov 2017 04:31:58 -0700 Subject: [PATCH] removed ncdump test dependencies for tst_netcdf4.sh --- ncdump/Makefile.am | 6 ++---- ncdump/tst_h_rdc0.c | 9 +++++---- ncdump/tst_netcdf4.sh | 40 +++++++--------------------------------- ncdump/tst_output.sh | 2 ++ 4 files changed, 16 insertions(+), 41 deletions(-) diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am index 5247ff685..ed6724e6e 100644 --- a/ncdump/Makefile.am +++ b/ncdump/Makefile.am @@ -86,10 +86,8 @@ run_utf8_nc4_tests.sh run_back_comp_tests.sh run_ncgen_nc4_tests.sh \ tst_ncgen4.sh # Record dependencies between netcdf-4 test scripts. -tst_netcdf4.log: run_ncgen_tests.log tst_output.log tst_ncgen4.log \ -tst_formatx4.log -tst_nccopy4.log: tst_netcdf4.log tst_fillbug.log tst_netcdf4_4.log \ -tst_h_scalar.log tst_ctest.log +tst_nccopy4.log: run_ncgen_tests.log tst_output.log tst_ncgen4.log \ +tst_fillbug.log tst_netcdf4_4.log tst_h_scalar.log tst_ctest.log run_ncgen_nc4_tests.log: run_ncgen_tests.log tst_output.log \ tst_nccopy3.log run_utf8_nc4_tests.log: run_utf8_tests.log diff --git a/ncdump/tst_h_rdc0.c b/ncdump/tst_h_rdc0.c index 7edf354a9..6eb9124b0 100644 --- a/ncdump/tst_h_rdc0.c +++ b/ncdump/tst_h_rdc0.c @@ -3,7 +3,10 @@ See COPYRIGHT file for conditions of use. Use HDF5 to read c0.nc, a file created by ncdump. This check was - added to detect a problem in the early HDF5 1.8.0 releases. + added to detect a problem in the early HDF5 1.8.0 releases. This + program is called from the test script tst_netcdf4.sh, which uses + ncgen to create the test file c0_tst_netcdf4.nc, which this program + reads with HDF5. Ed Hartnett */ @@ -11,7 +14,7 @@ #include "err_macros.h" #include -#define FILE_NAME "c0.nc" +#define FILE_NAME "c0_tst_netcdf4.nc" #define MAX_NAME 1024 int @@ -19,7 +22,6 @@ main() { printf("\n*** Checking HDF5 file c0.nc.\n"); printf("*** Checking HDF5 objcts..."); - { hid_t fileid, grpid; hsize_t num_obj, i; @@ -42,6 +44,5 @@ main() H5Fclose(fileid) < 0) ERR; } SUMMARIZE_ERR; - FINAL_RESULTS; } diff --git a/ncdump/tst_netcdf4.sh b/ncdump/tst_netcdf4.sh index 905cb0595..e816b0698 100755 --- a/ncdump/tst_netcdf4.sh +++ b/ncdump/tst_netcdf4.sh @@ -8,87 +8,61 @@ if test "x$srcdir" = x ; then srcdir=`pwd`; fi set -e echo "" -echo "*** Testing ncgen and ncdump test output for netCDF-4 format." -# echo "*** creating netcdf-4 file c0_4.nc from c0_4.cdl..." -${NCGEN} -k nc4 -b -o c0_4.nc ${ncgenc04} -# echo "*** creating c1_4.cdl from c0_4.nc..." -${NCDUMP} -n c1 c0_4.nc | sed 's/e+0/e+/g' > c1_4.cdl -# echo "*** comparing c1_4.cdl with ref_ctest1_nc4.cdl..." -diff -b c1_4.cdl $srcdir/ref_ctest1_nc4.cdl +echo "*** Testing ncgen and ncdump for netCDF-4 format." +${NCGEN} -k nc4 -b -o c0_4_tst_netcdf4.nc ${ncgenc04} +${NCDUMP} -n c1 c0_4_tst_netcdf4.nc | sed 's/e+0/e+/g' > c1_4_tst_netcdf4.cdl +diff -b c1_4_tst_netcdf4.cdl $srcdir/ref_ctest1_nc4.cdl -echo "*** Testing ncgen and ncdump test output for netCDF-4 classic format." -# echo "*** creating netcdf-4 classic file c0.nc from c0.cdl..." -${NCGEN} -k nc7 -b -o c0.nc ${ncgenc0} -# echo "*** creating c1.cdl from c0.nc..." +echo "*** Creating test output c0_tst_netcdf4.nc." +${NCGEN} -k nc7 -b -o c0_tst_netcdf4.nc ${ncgenc0} -echo "*** Testing that program tst_h_rdc0 can read c0.cdl." +echo "*** Testing that program tst_h_rdc0 can read c0_tst_netcdf4.nc." ${execdir}/tst_h_rdc0 -# echo "*** comparing c1.cdl with ref_ctest1_nc4c.cdl..." -diff -b c1.cdl $srcdir/ref_ctest1_nc4c.cdl - echo "*** Running tst_create_files.c to create test files." ${execdir}/tst_create_files echo "*** Testing tst_create_files output for netCDF-4 features." ${NCDUMP} tst_solar_1.nc | sed 's/e+0/e+/g' > tst_solar_1.cdl -# echo "*** comparing tst_solar_1.cdl with ref_tst_solar_1.cdl..." diff -b tst_solar_1.cdl $srcdir/ref_tst_solar_1.cdl ${NCDUMP} tst_solar_2.nc | sed 's/e+0/e+/g' > tst_solar_2.cdl -# echo "*** comparing tst_solar_2.cdl with ref_tst_solar_2.cdl..." diff -b tst_solar_2.cdl $srcdir/ref_tst_solar_2.cdl echo "*** Running tst_group_data.c to create test files." ${execdir}/tst_group_data ${NCDUMP} tst_group_data.nc | sed 's/e+0/e+/g' > tst_group_data.cdl -# echo "*** comparing tst_group_data.cdl with ref_tst_group_data.cdl..." diff -b tst_group_data.cdl $srcdir/ref_tst_group_data.cdl -# Temporary hack to skip a couple tests that won't work in windows -# without changing the format of the string. See: -# -# http://www.mingw.org/wiki/Posix_path_conversion - -if [[ "$OSTYPE" != 'msys' ]]; then echo "*** Testing -v option with absolute name and groups..." ${NCDUMP} -v /g2/g3/var tst_group_data.nc | sed 's/e+0/e+/g' > tst_group_data.cdl -# echo "*** comparing tst_group_data.cdl with ref_tst_group_data_v23.cdl..." diff -b tst_group_data.cdl $srcdir/ref_tst_group_data_v23.cdl -fi echo "*** Testing -v option with relative name and groups..." ${NCDUMP} -v var,var2 tst_group_data.nc | sed 's/e+0/e+/g' > tst_group_data.cdl -# echo "*** comparing tst_group_data.cdl with ref_tst_group_data.cdl..." diff -b tst_group_data.cdl $srcdir/ref_tst_group_data.cdl echo "*** Running tst_enum_data.c to create test files." ${execdir}/tst_enum_data ${NCDUMP} tst_enum_data.nc | sed 's/e+0/e+/g' > tst_enum_data.cdl -# echo "*** comparing tst_enum_data.cdl with ref_tst_enum_data.cdl..." diff -b tst_enum_data.cdl $srcdir/ref_tst_enum_data.cdl echo "*** Running tst_opaque_data.c to create test files." ${execdir}/tst_opaque_data ${NCDUMP} tst_opaque_data.nc | sed 's/e+0/e+/g' > tst_opaque_data.cdl -# echo "*** comparing tst_opaque_data.cdl with ref_tst_opaque_data.cdl..." diff -b tst_opaque_data.cdl $srcdir/ref_tst_opaque_data.cdl echo "*** Running tst_vlen_data.c to create test files." ${execdir}/tst_vlen_data ${NCDUMP} tst_vlen_data.nc | sed 's/e+0/e+/g' > tst_vlen_data.cdl -# echo "*** comparing tst_vlen_data.cdl with ref_tst_vlen_data.cdl..." diff -b tst_vlen_data.cdl $srcdir/ref_tst_vlen_data.cdl echo "*** Running tst_comp.c to create test files." ${execdir}/tst_comp ${NCDUMP} tst_comp.nc | sed 's/e+0/e+/g' > tst_comp.cdl -# echo "*** comparing tst_comp.cdl with ref_tst_comp.cdl..." diff -b tst_comp.cdl $srcdir/ref_tst_comp.cdl -# echo "*** creating tst_nans.cdl from tst_nans.nc" echo "*** Running tst_nans.c to create test files." ${execdir}/tst_nans ${NCDUMP} tst_nans.nc | sed 's/e+0/e+/g' > tst_nans.cdl -# echo "*** comparing ncdump of generated file with ref_tst_nans.cdl ..." diff -b tst_nans.cdl $srcdir/ref_tst_nans.cdl # Do unicode test only if it exists => BUILD_UTF8 is true diff --git a/ncdump/tst_output.sh b/ncdump/tst_output.sh index c8a88679e..c13c39389 100755 --- a/ncdump/tst_output.sh +++ b/ncdump/tst_output.sh @@ -16,6 +16,8 @@ echo "*** creating c0.nc from c0.cdl..." ${NCGEN} -b -o c0.nc ${ncgenc0} echo "*** creating c1.cdl from c0.nc..." ${NCDUMP} -n c1 ${builddir}/c0.nc | sed 's/e+0/e+/g' > c1.cdl +echo "*** comparing c1.cdl with ref_ctest1_nc4c.cdl..." +diff -b c1.cdl $srcdir/ref_ctest1_nc4c.cdl echo "*** comparing ncdump of C program output (ctest1.cdl) with c1.cdl..." diff -b c1.cdl ctest1.cdl echo "*** test output for ncdump -k"