Fleshed out test script, wired into cmakelists.txt

This commit is contained in:
Ward Fisher 2016-06-02 14:19:36 -06:00
parent ab43f75416
commit 2d0de087fa
2 changed files with 24 additions and 1 deletions

View File

@ -77,7 +77,7 @@ IF(USE_HDF4_FILE_TESTS AND NOT MSVC)
build_bin_test(tst_chunk_hdf4)
add_sh_test(nc_test4 run_chunk_hdf4)
add_bin_test(nc_test4 tst_h4_lendian)
add_sh_test(nc_test4 tst_hdf4_read_var)
ENDIF()

View File

@ -0,0 +1,23 @@
#!/bin/bash
# This shell script tests that an hdf4 file can be read a
# variable at a time.
#
# this was added in support of https://github.com/Unidata/netcdf-c/issues/264
FILE=tst_interops2.h4
set -e
echo ""
echo "*** Testing reading an individual variable from an HDF4 file."
../ncdump/ncdump -v hdf4_dataset_type_0 $FILE
../ncdump/ncdump -v hdf4_dataset_type_1 $FILE
../ncdump/ncdump -v hdf4_dataset_type_2 $FILE
../ncdump/ncdump -v hdf4_dataset_type_3 $FILE
../ncdump/ncdump -v hdf4_dataset_type_4 $FILE
../ncdump/ncdump -v hdf4_dataset_type_5 $FILE
../ncdump/ncdump -v hdf4_dataset_type_6 $FILE
../ncdump/ncdump -v hdf4_dataset_type_7 $FILE
echo "*** Success."