netcdf-c/ncdump/tst_ncgen_shared.sh

153 lines
3.0 KiB
Bash
Raw Normal View History

2010-06-03 21:24:43 +08:00
#!/bin/sh
Primary change: add dap4 support Specific changes: 1. Add dap4 code: libdap4 and dap4_test. Note that until the d4ts server problem is solved, dap4 is turned off. 2. Modify various files to support dap4 flags: configure.ac, Makefile.am, CMakeLists.txt, etc. 3. Add nc_test/test_common.sh. This centralizes the handling of the locations of various things in the build tree: e.g. where is ncgen.exe located. See nc_test/test_common.sh for details. 4. Modify .sh files to use test_common.sh 5. Obsolete separate oc2 by moving it to be part of netcdf-c. This means replacing code with netcdf-c equivalents. 5. Add --with-testserver to configure.ac to allow override of the servers to be used for --enable-dap-remote-tests. 6. There were multiple versions of nctypealignment code. Try to centralize in libdispatch/doffset.c and include/ncoffsets.h 7. Add a unit test for the ncuri code because of its complexity. 8. Move the findserver code out of libdispatch and into a separate, self contained program in ncdap_test and dap4_test. 9. Move the dispatch header files (nc{3,4}dispatch.h) to .../include because they are now shared by modules. 10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts. 11. Make use of MREMAP if available 12. Misc. minor changes e.g. - #include <config.h> -> #include "config.h" - Add some no-install headers to /include - extern -> EXTERNL and vice versa as needed - misc header cleanup - clean up checking for misc. unix vs microsoft functions 13. Change copyright decls in some files to point to LICENSE file. 14. Add notes to RELEASENOTES.md
2017-03-09 08:01:10 +08:00
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
2010-06-03 21:24:43 +08:00
2013-07-11 05:19:05 +08:00
# To add a new test,
# 1. put the .cdl file in the 'cdl' directory
2013-07-11 05:19:05 +08:00
# 2. put the result of running ncgen then ncdump
# into the directory 'expected' as .dmp
# 3. Modify the file tst_ncgen_shared.sh to add
2013-07-11 05:19:05 +08:00
# the test to the end of the TESTS4 variable
# or CLASSIC variable.
# 4. Add the new files into cdl/Makfile.am
# and expected/Makefile.am
2013-07-11 05:19:05 +08:00
set -e
RESULTSDIR="./results_$$"
2010-06-03 21:24:43 +08:00
#SHOWXFAILS=1
# Locate the cdl and expected directory
cdl="${srcdir}/cdl"
expected="${srcdir}/expected"
2010-06-03 21:24:43 +08:00
case "x${KFLAG}" in
x1) CLASSIC=1; MODE=3;;
x2) CLASSIC=1; MODE=3;;
x3) CLASSIC=0; MODE=4;;
x4) CLASSIC=1; MODE=3;;
*) echo "illegal KFLAG" ; exit 1;;
esac
# Define the set of tests that can be
# processed with either the -k nc3 or -k nc4 or -k nc7 flag
2010-06-03 21:24:43 +08:00
# The netcdf-3 tests are divided into two parts
# These test can be run when --enable-netcdf-4 is false
CLASSIC3="\
nc_enddef \
ref_tst_unicode \
ref_tst_utf8 \
simple_xy \
small \
nc_sync \
ref_tst_small \
small2 \
tst_ncml
n3time \
ref_tst_chardata \
ref_tst_nul3 \
ref_tst_long_charconst \
tst_chararray \
unlimtest1 \
ref_keyword"
2010-06-03 21:24:43 +08:00
NONCLASSIC3="\
test0 \
sfc_pres_temp \
fills \
c0 \
example_good \
pres_temp_4D \
ref_nctst \
ref_nctst_64bit_offset \
ref_ctest1_nc4 \
ref_ctest1_nc4c \
ref_nctst_netcdf4 \
ref_nctst_netcdf4_classic \
ref_tst_unlim2 \
ref_tst_names \
"
2010-06-03 21:24:43 +08:00
if test "${CLASSIC}" = "1" ; then
TESTS3="${CLASSIC3}"
else
TESTS3="${CLASSIC3} ${NONCLASSIC3}"
fi
# Define the set of tests that must be
# processed with the -k nc4 flag
2010-06-03 21:24:43 +08:00
TESTS4="\
ref_dimscope \
ref_typescope \
ref_tst_string_data \
ref_tst_comp \
ref_tst_comp2 \
ref_tst_comp3 \
ref_tst_group_data \
ref_tst_opaque_data \
ref_tst_solar_1 \
ref_tst_solar_2 \
ref_tst_enum_data \
ref_tst_special_atts \
ref_tst_nans \
ref_solar \
unlimtest2 \
2013-07-11 04:53:50 +08:00
ref_niltest \
ref_tst_h_scalar \
ref_tst_nul4 \
ref_tst_econst \
ref_tst_econst2 \
"
2010-06-03 21:24:43 +08:00
Fix more memory leaks in netcdf-c library This is a follow up to PR https://github.com/Unidata/netcdf-c/pull/1173 Sorry that it is so big, but leak suppression can be complex. This PR fixes all remaining memory leaks -- as determined by -fsanitize=address, and with the exceptions noted below. Unfortunately. there remains a significant leak that I cannot solve. It involves vlens, and it is unclear if the leak is occurring in the netcdf-c library or the HDF5 library. I have added a check_PROGRAM to the ncdump directory to show the problem. The program is called tst_vlen_demo.c To exercise it, build the netcdf library with -fsanitize=address enabled. Then go into ncdump and do a "make clean check". This should build tst_vlen_demo without actually executing it. Then do the command "./tst_vlen_demo" to see the output of the memory checker. Note the the lost malloc is deep in the HDF5 library (in H5Tvlen.c). I am temporarily working around this error in the following way. 1. I modified several test scripts to not execute known vlen tests that fail as described above. 2. Added an environment variable called NC_VLEN_NOTEST. If set, then those specific tests are suppressed. This should mean that the --disable-utilities option to ./configure should not need to be set to get a memory leak clean build. This should allow for detection of any new leaks. Note: I used an environment variable rather than a ./configure option to control the vlen tests. This is because it is temporary (I hope) and because it is a bit tricky for shell scripts to access ./configure options. Finally, as before, this only been tested with netcdf-4 and hdf5 support.
2018-11-16 01:00:38 +08:00
if test "x$NC_VLEN_NOTEST" = x ; then
TESTS4="$TESTS4 ref_tst_vlen_data ref_tst_vlen_data2"
fi
# These tests should not be cycle tested because ncdump loses information
NOCYCLE="ref_tst_econst"
2010-06-03 21:24:43 +08:00
SPECIALTESTS3="ref_tst_special_atts3"
SPECIALTESTS="${SPECIALTESTS3} ref_tst_special_atts"
2010-06-03 21:24:43 +08:00
XFAILTESTS=""
# Fails because ncdump does not output multiple unlim char types correctly
XFAILTESTS="ref_tst_unlim2 $XFAILTESTS"
# Fails because ?
XFAILTESTS="ref_const_test $XFAILTESTS"
# Fails because ?
XFAILTESTS="ref_tst_chardata $XFAILTESTS"
# Fails because ncdump is crashing
2014-07-24 01:25:49 +08:00
#XFAILTESTS="ref_tst_econst $XFAILTESTS"
2010-06-03 21:24:43 +08:00
# Following are generally not run
# Because of the size of their output
BIGTESTS3="\
bigf1 \
bigf2 \
bigr1 \
bigr2"
# Following deliberately produces a very large
# file: too large for netcdf to handle
# Currently not used because of space and time
# constraints
XFAILBIG="bigf3"
BIGTESTS4="ref_tst_solar_1"
# This test is both big and slow
# File was too large to reasonably include
# so I removed it
#BIGBIG3="gfs1"
BIGTESTS="${BIGTESTS3} ${BIGTESTS4} ${BIGBIG3}"
failcount=0
passcount=0
xfailcount=0
rm -fr $RESULTSDIR