Merge pull request #893 from Unidata/pr-aggregation2.wif

Second Try: Aggregation of Pull Requests
This commit is contained in:
Ward Fisher 2018-03-02 19:26:01 -07:00 committed by GitHub
commit 04be884eb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 43 additions and 311 deletions

View File

@ -171,14 +171,6 @@ if test "x$enable_jna" = xyes ; then
AC_DEFINE([JNA], [1], [if true, include jna bug workaround code])
fi
# Does the user want to run extra tests with valgrind?
AC_MSG_CHECKING([whether extra valgrind tests should be run])
AC_ARG_ENABLE([valgrind-tests],
[AS_HELP_STRING([--enable-valgrind-tests],
[build with valgrind-tests (valgrind is required, static builds only)])])
test "x$enable_valgrind_tests" = xyes || enable_valgrind_tests=no
AC_MSG_RESULT($enable_valgrind_tests)
# Does the user want to build netcdf-4?
AC_MSG_CHECKING([whether we should build netCDF-4])
AC_ARG_ENABLE([netcdf-4], [AS_HELP_STRING([--disable-netcdf-4],
@ -669,14 +661,6 @@ AC_MSG_NOTICE([setting up libtool])
LT_PREREQ([2.2])
LT_INIT()
# Valgrind tests don't work with shared builds because of some libtool
# weirdness.
if test "x$enable_shared" = xyes; then
if test $enable_valgrind_tests = yes; then
AC_MSG_ERROR([No valgrind tests with shared libraries])
fi
fi
AC_MSG_NOTICE([finding other utilities])
# Is m4 installed? If not, bail.
@ -1212,7 +1196,6 @@ AM_CONDITIONAL(USE_SZIP, [test "x$ac_cv_func_H5Z_SZIP" = xyes])
AM_CONDITIONAL(USE_PNETCDF_DIR, [test ! "x$PNETCDFDIR" = x])
AM_CONDITIONAL(USE_LOGGING, [test "x$enable_logging" = xyes])
AM_CONDITIONAL(CROSS_COMPILING, [test "x$cross_compiling" = xyes])
AM_CONDITIONAL(USE_VALGRIND_TESTS, [test "x$enable_valgrind_tests" = xyes])
AM_CONDITIONAL(USE_NETCDF4, [test x$enable_netcdf_4 = xyes])
AM_CONDITIONAL(USE_HDF4, [test x$enable_hdf4 = xyes])
AM_CONDITIONAL(USE_HDF4_FILE_TESTS, [test x$enable_hdf4_file_tests = xyes])

View File

@ -48,22 +48,10 @@ if USE_NETCDF4
TESTS += run_examples4.sh
endif #USE_NETCDF4
# This will run a bunch of the test programs with valgrind, the memory
# checking tool. (Valgrind must be present for this to work.)
if USE_VALGRIND_TESTS
TESTS += run_valgrind_tests.sh
endif # USE_VALGRIND_TESTS
if USE_NETCDF4
if USE_VALGRIND_TESTS
TESTS += run_nc4_valgrind_tests.sh
endif # USE_VALGRIND_TESTS
endif # USE_NETCDF4
# These files are created by the tests.
CLEANFILES = *.nc
EXTRA_DIST = run_valgrind_tests.sh run_nc4_valgrind_tests.sh \
CMakeLists.txt run_examples.sh run_examples4.sh
EXTRA_DIST = CMakeLists.txt run_examples.sh run_examples4.sh
if ENABLE_FILTER_TESTING # => shared and netcdf-4
BUILT_SOURCES = findplugin.sh

View File

@ -1,24 +0,0 @@
#!/bin/sh
# This shell runs the tests with valgrind, for netCDF-4.
# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $
set -e
echo ""
echo "Testing netCDF-4 test programs with valgrind..."
# These are my test programs.
list='simple_nc4_wr simple_nc4_rd simple_xy_nc4_wr '\
'simple_xy_nc4_rd '
for tst in $list; do
echo ""
cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst"
echo "$cmd1:"
$cmd1
done
echo "SUCCESS!!!"
exit 0

View File

@ -1,24 +0,0 @@
#!/bin/sh
# This shell runs the tests with valgrind.
# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list='simple_xy_wr simple_xy_rd sfc_pres_temp_wr '\
'sfc_pres_temp_rd pres_temp_4D_wr pres_temp_4D_rd '
for tst in $list; do
echo ""
cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst"
echo "$cmd1:"
$cmd1
done
echo "SUCCESS!!!"
exit 0

View File

@ -38,17 +38,10 @@ check_PROGRAMS += tst_h_par
TESTS += run_par_tests.sh
endif
# This will run a bunch of the test programs with valgrind, the memory
# checking tool. (Valgrind must be present for this to work.)
if USE_VALGRIND_TESTS
TESTS += run_valgrind_tests.sh
endif # USE_VALGRIND_TESTS
# We must include these files in the distribution.
EXTRA_DIST = run_par_tests.sh run_valgrind_tests.sh \
ref_tst_h_compounds.h5 ref_tst_h_compounds2.h5 run_par_tests.sh \
run_valgrind_tests.sh ref_tst_compounds.nc h5_err_macros.h \
CMakeLists.txt
EXTRA_DIST = run_par_tests.sh ref_tst_h_compounds.h5 \
ref_tst_h_compounds2.h5 run_par_tests.sh ref_tst_compounds.nc \
h5_err_macros.h CMakeLists.txt
# Clean up test results.
CLEANFILES = tst_h_*.h5

View File

@ -1,29 +0,0 @@
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
# This shell runs the tests with valgrind.
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list='tst_h_files tst_h_files2 tst_h_files4 tst_h_atts '\
'tst_h_atts3 tst_h_atts4 tst_h_vars tst_h_vars2 tst_h_vars3 tst_h_grps '\
'tst_h_compounds tst_h_compounds2 tst_h_wrt_cmp tst_h_rd_cmp tst_h_vl '\
'tst_h_opaques tst_h_strings tst_h_strings1 tst_h_strings2 tst_h_ints '\
'tst_h_dimscales tst_h_dimscales1 tst_h_dimscales2 tst_h_dimscales3 '\
'tst_h_enums'
for tst in $list; do
echo ""
cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst"
echo "$cmd1:"
$cmd1
done
echo "SUCCESS!!!"
exit 0

View File

@ -37,7 +37,7 @@
# define alloca __builtin_alloca
# endif
#else
# if HAVE_ALLOCA_H
# ifdef HAVE_ALLOCA_H
# include <alloca.h>
# elif defined(_AIX)
# pragma alloca

View File

@ -88,6 +88,11 @@ find_in_NCList(int ext_ncid)
unsigned int ncid = ((unsigned int)ext_ncid) >> ID_SHIFT;
if(numfiles > 0 && nc_filelist != NULL && ncid < NCFILELISTLENGTH)
f = nc_filelist[ncid];
/* for classic files, ext_ncid must be a multiple of (1<<ID_SHIFT) */
if (f != NULL && f->model == NC_FORMATX_NC3 && (ext_ncid % (1<<ID_SHIFT)))
return NULL;
return f;
}

View File

@ -83,23 +83,11 @@ if USE_PNETCDF
TESTS += run_pnetcdf_test.sh
endif
# This will run a bunch of the test programs with valgrind, the memory
# checking tool. (Valgrind must be present for this to work.)
if USE_VALGRIND_TESTS
if USE_NETCDF4
TESTS_ENVIRONMENT = USE_NETCDF4=1
else
TESTS_ENVIRONMENT = USE_NETCDF4=0
endif
TESTS += run_valgrind_tests.sh
endif # USE_VALGRIND_TESTS
# Distribute the .c files so that m4 isn't required on the users
# machine.
EXTRA_DIST = test_get.m4 test_put.m4 run_valgrind_tests.sh \
run_diskless.sh run_diskless2.sh run_diskless5.sh run_mmap.sh \
run_pnetcdf_test.sh test_read.m4 test_write.m4 ref_tst_diskless2.cdl \
tst_diskless5.cdl CMakeLists.txt
EXTRA_DIST = test_get.m4 test_put.m4 run_diskless.sh run_diskless2.sh \
run_diskless5.sh run_mmap.sh run_pnetcdf_test.sh test_read.m4 \
test_write.m4 ref_tst_diskless2.cdl tst_diskless5.cdl CMakeLists.txt
# These files are created by the tests.
CLEANFILES = nc_test_classic.nc nc_test_64bit.nc nc_test_netcdf4.nc \

View File

@ -1,29 +0,0 @@
#!/bin/sh
# This shell runs the tests with valgrind.
# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list='t_nc tst_norm tst_names tst_misc nc_test'
# If we are running with netcdf4, then add tst_atts
if test "x$USE_NETCDF4" = "x1" ; then
list="$list tst_atts"
fi
# These don't work yet: tst_fills tst_xplatform2 tst_interops6 tst_strings
for tst in $list; do
echo ""
cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst"
echo "$cmd1:"
$cmd1
done
echo "SUCCESS!!!"
exit 0

View File

@ -24,8 +24,8 @@
#define NDIMS 1
#define DIMLEN 1
#define ERROR {printf("Error at line %d: %s\n",__LINE__,nc_strerror(res)); continue;}
#define ERRORI {printf("Error at line %d (loop=%d): %s\n",__LINE__,i,nc_strerror(res)); continue;}
#define ERROR {printf("Error at line %d: %s\n",__LINE__,nc_strerror(res)); nerrs++; continue;}
#define ERRORI {printf("Error at line %d (loop=%d): %s\n",__LINE__,i,nc_strerror(res)); nerrs++; continue;}
int
main(int argc, char **argv)
@ -197,10 +197,14 @@ main(int argc, char **argv)
"x\xED\xAE\x80\xED\xB0\x80",
"x\xED\xAE\x80\xED\xBF\xBF",
"x\xED\xAF\xBF\xED\xB0\x80",
"x\xED\xAF\xBF\xED\xBF\xBF",
"x\xEF\xBF\xBE", /* other illegal code positions */
"x\xED\xAF\xBF\xED\xBF\xBF"
#if 0
/* The two below is legal since UTF8PROC_VERSION_MAJOR 2 */
"x\xEF\xBF\xBE", /* other illegal code positions */
"x\xEF\xBF\xBF"
#endif
};
int nerrs=0;
int i, j;
#define NUM_BAD (sizeof notvalid / sizeof notvalid[0])
#define NUM_GOOD (sizeof valid / sizeof valid[0])
@ -221,8 +225,10 @@ main(int argc, char **argv)
NC_FORMAT_CLASSIC
,
NC_FORMAT_64BIT_OFFSET
#ifdef USE_CDF5
,
NC_FORMAT_CDF5
#endif
#ifdef USE_NETCDF4
,
NC_FORMAT_NETCDF4
@ -327,6 +333,7 @@ main(int argc, char **argv)
SUMMARIZE_ERR;
}
total_err += nerrs;
FINAL_RESULTS;
#ifdef TEST_PNETCDF

View File

@ -9,7 +9,7 @@ SET(NC4_TESTS tst_dims tst_dims2 tst_dims3 tst_files tst_files4
cdm_sea_soundings tst_vl tst_atts1 tst_atts2 tst_vars2 tst_files5
tst_files6 tst_sync tst_h_strbug tst_h_refs tst_h_scalar tst_rename
tst_rename2 tst_h5_endians tst_atts_string_rewrite tst_put_vars_two_unlim_dim
tst_hdf5_file_compat tst_fill_attr_vanish tst_rehash tst_types)
tst_hdf5_file_compat tst_fill_attr_vanish tst_rehash tst_types tst_bug324)
# Note, renamegroup needs to be compiled before run_grp_rename
@ -89,7 +89,6 @@ IF(USE_HDF4_FILE_TESTS AND NOT MSVC)
add_bin_test_no_prefix(tst_interops2)
build_bin_test_no_prefix(tst_interops3)
add_sh_test(nc_test4 run_get_hdf4_files)
add_bin_test(nc_test4 tst_bug324)
add_sh_test(nc_test4 tst_formatx_hdf4)
build_bin_test(tst_chunk_hdf4)
add_sh_test(nc_test4 run_chunk_hdf4)

View File

@ -131,15 +131,6 @@ TESTS += tst_filter.sh
endif
endif
# This will run a bunch of the test programs with valgrind, the memory
# checking tool. (Valgrind must be present for this to work.)
if USE_VALGRIND_TESTS
TESTS += run_valgrind_tests.sh run_valgrind_tests2.sh
if USE_HDF4
TESTS += run_hdf4_valgrind_tests.sh
endif # USE_HDF4
endif # USE_VALGRIND_TESTS
# This are extra tests that will only be run if netcdf-4 is configured
# with --enable-parallel-tests.
if TEST_PARALLEL4
@ -148,23 +139,21 @@ tst_parallel4 tst_nc4perf tst_mode tst_simplerw_coll_r
TESTS += run_par_test.sh
endif
EXTRA_DIST = run_par_test.sh run_bm.sh run_bm_test1.sh \
run_bm_test2.sh run_bm_radar_2D.sh run_bm_radar_2D_compression1.sh \
run_par_bm_test.sh run_bm_elena.sh run_par_bm_radar_2D.sh \
run_bm_radar_2D_endianness1.sh run_tst_chunks.sh ref_chunks1.cdl \
ref_chunks2.cdl run_get_hdf4_files.sh run_valgrind_tests.sh \
run_valgrind_tests2.sh run_bm_ar4.sh ref_tst_compounds.nc \
run_hdf4_valgrind_tests.sh ref_tst_xplatform2_1.nc \
ref_tst_xplatform2_2.nc ref_tst_dims.nc ref_tst_interops4.nc \
run_get_knmi_files.sh CMakeLists.txt run_grp_rename.sh \
tst_formatx_hdf4.sh run_chunk_hdf4.sh tst_h5_endians.c \
tst_h4_lendian.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_hdf4_read_var.sh \
ref_contiguous.hdf4 ref_chunked.hdf4 tst_szip.sh ref_szip.h5 ref_szip.cdl \
tst_filter.sh bzip2.cdl filtered.cdl unfiltered.cdl ref_bzip2.c \
findplugin.in
EXTRA_DIST = run_par_test.sh run_bm.sh run_bm_test1.sh \
run_bm_test2.sh run_bm_radar_2D.sh run_bm_radar_2D_compression1.sh \
run_par_bm_test.sh run_bm_elena.sh run_par_bm_radar_2D.sh \
run_bm_radar_2D_endianness1.sh run_tst_chunks.sh ref_chunks1.cdl \
ref_chunks2.cdl run_get_hdf4_files.sh run_bm_ar4.sh \
ref_tst_compounds.nc ref_tst_xplatform2_1.nc ref_tst_xplatform2_2.nc \
ref_tst_dims.nc ref_tst_interops4.nc run_get_knmi_files.sh \
CMakeLists.txt run_grp_rename.sh tst_formatx_hdf4.sh \
run_chunk_hdf4.sh tst_h5_endians.c tst_h4_lendian.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_hdf4_read_var.sh ref_contiguous.hdf4 ref_chunked.hdf4 tst_szip.sh \
ref_szip.h5 ref_szip.cdl tst_filter.sh bzip2.cdl filtered.cdl \
unfiltered.cdl ref_bzip2.c findplugin.in
CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \
bm_radar.nc bm_radar1.nc radar_3d_compression_test.txt \

View File

@ -1,25 +0,0 @@
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
# This shell runs the HDF4 tests with valgrind.
# $Id: run_hdf4_valgrind_tests.sh,v 1.1 2009/07/13 14:53:52 ed Exp $
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list='tst_interops2 '
for tst in $list; do
echo ""
echo "Memory testing with $tst:"
valgrind -q --error-exitcode=2 --leak-check=full ./$tst
done
echo "SUCCESS!!!"
exit 0

View File

@ -1,32 +0,0 @@
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
# This shell runs the tests with valgrind.
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list='tst_dims tst_dims2 tst_dims3 tst_files tst_files4 tst_vars '\
'tst_varms tst_unlim_vars tst_converts tst_converts2 tst_grps '\
'tst_compounds tst_compounds2 tst_compounds3 tst_opaques tst_strings '\
'tst_strings2 tst_interops tst_interops4 tst_interops5 tst_interops6 '\
'tst_coords tst_coords2 tst_coords3 tst_vars3 tst_chunks '\
'tst_utf8 tst_fills tst_fills2 tst_fillbug tst_xplatform '\
'tst_h_atts2 tst_endian_fill tst_atts'
# These don't work yet: tst_grps2 tst_xplatform2 tst_enums
for tst in $list; do
echo ""
cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst"
echo "$cmd1:"
$cmd1
done
echo "SUCCESS!!!"
exit 0

View File

@ -1,23 +0,0 @@
#!/bin/sh
# This shell runs the tests with valgrind.
# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list="t_type tst_camrun tst_vl tst_v2 tst_vars2 \
tst_atts2 tst_files tst_atts"
for tst in $list; do
echo ""
echo "Memory testing with $tst:"
valgrind -q --error-exitcode=2 --leak-check=full ./$tst
done
echo "SUCCESS!!!"
exit 0

View File

@ -50,8 +50,8 @@ main(int argc, char **argv)
/* Create a netcdf-3 file with one dim. */
if (nc_create(FILE_NAME, 0, &ncid)) ERR;
if (nc_def_dim(ncid, LAT_NAME, LAT_LEN, &dimid)) ERR;
/* Next line will work when PR #804 gets merged. */
/* if (nc_def_dim(ncid + TEST_VAL_42, LAT_NAME, LAT_LEN, &dimid) != NC_EBADID) ERR; */
if (nc_def_dim(ncid + TEST_VAL_42, LAT_NAME, LAT_LEN, &dimid) != NC_EBADID) ERR;
if (nc_close(ncid)) ERR;
/* Open the file and make sure nc_inq_dimids yeilds correct

View File

@ -16,7 +16,7 @@ AM_LDFLAGS += ${top_builddir}/liblib/libnetcdf.la
# generated in a pressurized chamber that exactly simulated the
# atmosphere on the surface of Mars.
EXTRA_DIST = ref_nctest_classic.nc ref_nctest_64bit_offset.nc \
compare_test_files.sh run_valgrind_tests.sh CMakeLists.txt
compare_test_files.sh CMakeLists.txt
CLEANFILES = nctest_*.nc test2.nc temp.tmp tst_*.nc \
nctest_classic.cdl ref_nctest_classic.cdl
@ -33,12 +33,6 @@ TEST_EXTENSIONS = .sh
# compare_test_files depends on nctest executing first.
compare_test_files.log: nctest.log
# This will the test program with valgrind, the memory checking
# tool. (Valgrind must be present for this to work.)
if USE_VALGRIND_TESTS
TESTS += run_valgrind_tests.sh
endif # USE_VALGRIND_TESTS
# These are the source files for the nctest program.
nctest_SOURCES = add.c add.h atttests.c cdftests.c dimtests.c driver.c \
emalloc.c emalloc.h error.c error.h misctest.c rec.c slabs.c testcdf.h \

View File

@ -1,28 +0,0 @@
#!/bin/sh
if test "x$srcdir" = x ; then srcdir=`pwd`; fi
. ../test_common.sh
# This shell runs the tests with valgrind.
# $Id: run_valgrind_tests.sh,v 1.9 2010/01/26 20:24:18 ed Exp $
set -e
echo ""
echo "Testing programs with valgrind..."
# These are my test programs.
list='nctest tst_rename'
# These don't work yet: tst_fills tst_xplatform2 tst_interops6 tst_strings
for tst in $list; do
echo ""
cmd1="valgrind -q --error-exitcode=2 --leak-check=full ./$tst"
echo "$cmd1:"
$cmd1
done
echo "SUCCESS!!!"
exit 0