netcdf-c/nc_test4/Makefile.am

154 lines
5.4 KiB
Makefile
Raw Normal View History

2018-08-25 02:48:42 +08:00
# This is part of the netCDF package. Copyright 2005-2018 University
# Corporation for Atmospheric Research/Unidata See COPYRIGHT file for
# conditions of use.
#
# This directory holds tests for netCDF-4. It is skipped if netCDF-4
# is not enabled.
#
# Ed Hartnett, Ward Fisher
2010-06-03 21:24:43 +08:00
# Put together AM_CPPFLAGS and AM_LDFLAGS.
include $(top_srcdir)/lib_flags.am
2010-06-03 21:24:43 +08:00
# Un comment to use a more verbose test driver
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
#SH_LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
#LOG_DRIVER = $(SHELL) $(top_srcdir)/test-driver-verbose
TEST_EXTENSIONS = .sh
# Link to our assembled library.
2011-06-03 06:46:15 +08:00
AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la
2018-08-07 00:57:19 +08:00
LDADD = ${top_builddir}/liblib/libnetcdf.la
2010-06-03 21:24:43 +08:00
# These are netCDF-4 C test programs which are built and run.
NC4_TESTS = tst_dims tst_dims2 tst_dims3 tst_files tst_files4 \
tst_vars tst_varms tst_unlim_vars tst_converts tst_converts2 tst_grps \
tst_grps2 tst_compounds tst_compounds2 tst_compounds3 tst_opaques \
tst_strings tst_strings2 tst_interops tst_interops4 tst_interops5 \
tst_interops6 tst_enums tst_coords tst_coords2 tst_coords3 tst_vars3 \
tst_vars4 tst_chunks tst_chunks2 tst_utf8 tst_fills tst_fills2 \
tst_fillbug tst_xplatform tst_xplatform2 tst_endian_fill tst_atts \
t_type cdm_sea_soundings tst_camrun tst_vl tst_atts1 tst_atts2 \
2017-11-17 02:30:35 +08:00
tst_vars2 tst_files5 tst_files6 tst_sync tst_h_scalar tst_rename \
2018-02-13 01:08:59 +08:00
tst_rename2 tst_h5_endians tst_atts_string_rewrite \
tst_hdf5_file_compat tst_fill_attr_vanish tst_rehash tst_filterparser \
2019-01-02 21:21:11 +08:00
tst_bug324 tst_types tst_atts3 tst_put_vars tst_elatefill tst_udf
# Temporary I hope
2017-06-01 05:01:02 +08:00
if !ISCYGWIN
NC4_TESTS += tst_h_strbug tst_h_refs
endif
# Build test programs plus programs used in test scripts.
2019-01-02 21:21:11 +08:00
check_PROGRAMS = $(NC4_TESTS) tst_empty_vlen_unlim
TESTS = $(NC4_TESTS) run_empty_vlen_test.sh
# Add these if large file tests are turned on.
if LARGE_FILE_TESTS
check_PROGRAMS += tst_large tst_large2
TESTS += tst_large tst_large2
endif
if BUILD_UTILITIES
2019-01-02 21:21:11 +08:00
check_PROGRAMS += renamegroup
TESTS += run_grp_rename.sh tst_misc.sh
endif
# If the v2 API was built, add its test program.
if BUILD_V2
check_PROGRAMS += tst_v2
TESTS += tst_v2
endif # BUILD_V2
2010-06-03 21:24:43 +08:00
# If benchmarks were turned on, build and run a bunch more tests.
2010-06-03 21:24:43 +08:00
if BUILD_BENCHMARKS
check_PROGRAMS += tst_create_files bm_file tst_chunks3 tst_ar4 \
tst_ar4_3d tst_ar4_4d bm_many_objs tst_h_many_atts bm_many_atts \
tst_files2 tst_files3 tst_mem tst_knmi bm_netcdf4_recs tst_wrf_reads \
tst_attsperf
2011-08-15 21:27:10 +08:00
bm_netcdf4_recs_SOURCES = bm_netcdf4_recs.c tst_utils.c
bm_many_atts_SOURCES = bm_many_atts.c tst_utils.c
bm_many_objs_SOURCES = bm_many_objs.c tst_utils.c
tst_ar4_3d_SOURCES = tst_ar4_3d.c tst_utils.c
tst_ar4_4d_SOURCES = tst_ar4_4d.c tst_utils.c
tst_files2_SOURCES = tst_files2.c tst_utils.c
tst_ar4_SOURCES = tst_ar4.c tst_utils.c
tst_h_many_atts_SOURCES = tst_h_many_atts.c tst_utils.c
bm_file_SOURCES = bm_file.c tst_utils.c
tst_knmi_SOURCES = tst_knmi.c tst_utils.c
tst_wrf_reads_SOURCES = tst_wrf_reads.c tst_utils.c
2011-12-16 04:24:54 +08:00
TESTS += tst_ar4_3d tst_create_files run_bm_test1.sh run_bm_elena.sh \
run_bm_test2.sh run_tst_chunks.sh tst_files3 tst_mem run_knmi_bm.sh \
tst_wrf_reads tst_attsperf
2018-08-23 22:21:55 +08:00
# tst_create_files creates files for other tests.
run_bm_test1.log: tst_create_files.log
run_bm_test2.log: tst_create_files.log
run_bm_elena.log: tst_create_files.log tst_files.log
2018-08-23 22:21:55 +08:00
# This will run a parallel I/O benchmark for parallel builds.
2015-08-16 06:26:35 +08:00
if TEST_PARALLEL4
2010-06-03 21:24:43 +08:00
TESTS += run_par_bm_test.sh
# This benchmark depends on tst_create_files being run.
run_par_bm_test.log: tst_create_files.log
2015-08-16 06:26:35 +08:00
endif # TEST_PARALLEL4
2010-06-03 21:24:43 +08:00
endif # BUILD_BENCHMARKS
# Szip Tests (requires ncdump)
2017-08-28 10:38:37 +08:00
if USE_SZIP
if BUILD_UTILITIES
2017-08-29 08:11:24 +08:00
check_PROGRAMS += test_szip h5testszip
2017-08-29 04:56:01 +08:00
TESTS += tst_szip.sh
2017-08-28 10:38:37 +08:00
endif
endif
2017-08-28 10:38:37 +08:00
# Filter Tests (requires ncdump and ncgen)
if ENABLE_FILTER_TESTING
if BUILD_UTILITIES
extradir =
extra_PROGRAMS = test_filter test_filter_misc
TESTS += tst_filter.sh
endif
endif
2010-06-03 21:24:43 +08:00
# This are extra tests that will only be run if netcdf-4 is configured
# with --enable-parallel-tests.
2015-08-16 06:26:35 +08:00
if TEST_PARALLEL4
2018-05-14 22:11:32 +08:00
check_PROGRAMS += tst_mpi_parallel tst_parallel tst_parallel3 \
2018-08-18 19:22:07 +08:00
tst_parallel4 tst_parallel5 tst_nc4perf tst_mode tst_simplerw_coll_r \
tst_mode
2010-06-03 21:24:43 +08:00
TESTS += run_par_test.sh
endif
if ENABLE_METADATA_PERF
check_PROGRAMS += bigmeta openbigmeta
TESTS += perftest.sh
endif
2018-08-25 02:48:42 +08:00
EXTRA_DIST = run_par_test.sh.in run_par_bm_test.sh.in run_bm_test1.sh \
run_bm_test2.sh run_bm_elena.sh run_tst_chunks.sh \
ref_tst_compounds.nc ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc \
ref_tst_dims.nc ref_tst_interops4.nc run_knmi_bm.sh CMakeLists.txt \
run_grp_rename.sh tst_h5_endians.c tst_atts_string_rewrite.c \
tst_put_vars_two_unlim_dim.c tst_empty_vlen_unlim.c \
run_empty_vlen_test.sh ref_hdf5_compat1.nc ref_hdf5_compat2.nc \
ref_hdf5_compat3.nc tst_misc.sh tdset.h5 tst_szip.sh ref_szip.h5 \
ref_szip.cdl tst_filter.sh bzip2.cdl filtered.cdl unfiltered.cdl \
ref_bzip2.c findplugin.in perftest.sh unfilteredvv.cdl filteredvv.cdl
2017-11-17 02:30:35 +08:00
2018-08-23 22:21:55 +08:00
CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \
tst_floats_1D.cdl floats_1D_3.nc floats_1D.cdl tst_*.nc \
tst_floats2_*.cdl tst_ints2_*.cdl tst_shorts2_*.cdl tst_elena_*.cdl \
tst_simple*.cdl tst_chunks.cdl pr_A1.* tauu_A1.* usi_01.* thetau_01.* \
tst_*.h5 tst_grp_rename.cdl tst_grp_rename.dmp ref_grp_rename.cdl \
foo1.nc tst_*.h4 test.nc testszip.nc test.h5 szip_dump.cdl \
perftest.txt bigmeta.nc bigvars.nc *.gz MSGCPP_*.nc \
floats*.nc floats*.cdl shorts*.nc shorts*.cdl ints*.nc ints*.cdl
DISTCLEANFILES = findplugin.sh run_par_test.sh
2018-03-29 03:54:05 +08:00
# If valgrind is present, add valgrind targets.
@VALGRIND_CHECK_RULES@