different attempt to deal with ncdump dependencies

This commit is contained in:
Ed Hartnett 2017-11-11 17:33:51 -07:00
parent 15b4dd9280
commit 05d251bfb5
4 changed files with 1385 additions and 1256 deletions

View File

@ -3,22 +3,6 @@ IF(BUILD_SHARED_LIBS AND WIN32)
remove_definitions(-DDLL_NETCDF)
ENDIF()
# These generate some files used in ncdump testing
# Specifically, they generate ctest0.nc ctest0_64.nc
# Before, these .nc files were placed in the same place as the
# .c file: namely build/ncdump.
# This complicates the shell tests that use it.
# ADD_CUSTOM_COMMAND(
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CONFIG_TYPE}/ctest.c
# COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest.c"
# "${CMAKE_CURRENT_BINARY_DIR}/ctest.c"
# )
# ADD_CUSTOM_COMMAND(
# OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/ctest64.c
# COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/ref_ctest64.c"
# "${CMAKE_CURRENT_BINARY_DIR}/ctest64.c"
# )
SET(ncdump_FILES ncdump.c vardata.c dumplib.c indent.c nctime0.c utils.c nciter.c)
SET(nccopy_FILES nccopy.c nciter.c chunkspec.c utils.c dimmap.c)
@ -120,6 +104,7 @@ ENDIF()
add_sh_test(ncdump tst_64bit)
add_bin_test(ncdump ret_ctest)
add_bin_test(ncdump ref_ctest64)
add_sh_test(ncdump tst_ctest)
add_sh_test(ncdump tst_output)
add_sh_test(ncdump tst_lengths)
add_sh_test(ncdump tst_calendars)

View File

@ -168,12 +168,12 @@ SUBDIRS=cdl expected
EXTRA_DIST += tst_ncgen_shared.sh tst_ncgen4.sh tst_ncgen4_classic.sh \
tst_ncgen4_diff.sh tst_ncgen4_cycle.sh tst_ctest.sh
CLEANFILES += results/*.nc results/*.dmp results/*.dmp2 tmp*.cdl \
c5.nc compound_datasize_test.nc compound_datasize_test2.nc ncf199.nc \
ref_camrun.c tst_c0.cdl tst_c0_4.cdl tst_c0_4c.cdl tst_c0_64.cdl \
tst_compound_datasize_test.cdl tst_compound_datasize_test2.cdl \
tst_gattenum.nc tst_ncf199.cdl tst_tst_gattenum.cdl \
tst_tst_usuffix.cdl tst_usuffix.nc tst_bug324.nc \
CLEANFILES += results/*.nc results/*.dmp results/*.dmp2 tmp*.cdl \
c5.nc compound_datasize_test.nc compound_datasize_test2.nc ncf199.nc \
ref_camrun.c tst_c0.cdl tst_c0_4.cdl tst_c0_4c.cdl tst_c0_64.cdl \
tst_compound_datasize_test.cdl tst_compound_datasize_test2.cdl \
tst_gattenum.nc tst_ncf199.cdl tst_tst_gattenum.cdl \
tst_tst_usuffix.cdl tst_usuffix.nc tst_bug324.nc ctest.c ctest64.c \
nccopy3_subset_out.nc
DISTCLEANFILES = results

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,13 @@ set -e
echo ""
echo "*** Testing that ncgen produces correct C code from c0.cdl."
${execdir}/ref_ctest
${NCGEN} -lc -o ctest0.nc c0.cdl > ctest.c
${NCGEN} -lc -o ctest0.nc $srcdir/c0.cdl > ctest.c
diff -b ctest.c $srcdir/ref_ctest.c
echo "*** All ncgen and ncdump test output for netCDF-4 format passed!"
echo "*** Testing that ncgen with c0.cdl for 64-bit offset format."
${execdir}/ref_ctest64
${NCGEN} -k2 -lc -o ctest0_64.nc $srcdir/c0.cdl > ctest64.c
diff -b ctest64.c $srcdir/ref_ctest64.c
echo "*** All tests of ncgen with ctest.c and ctest64.c passed!"
exit 0