2010-06-03 21:24:43 +08:00
|
|
|
#!/bin/sh
|
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,
|
2014-09-19 08:26:06 +08:00
|
|
|
# 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
|
2014-09-19 08:26:06 +08:00
|
|
|
# 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
|
2014-09-19 08:26:06 +08:00
|
|
|
# or CLASSIC variable.
|
|
|
|
# 4. Add the new files into cdl/Makfile.am
|
|
|
|
# and expected/Makefile.am
|
2013-07-11 05:19:05 +08:00
|
|
|
|
2010-08-10 04:39:36 +08:00
|
|
|
set -e
|
2010-06-03 21:24:43 +08:00
|
|
|
RESULTSDIR="./results"
|
|
|
|
#SHOWXFAILS=1
|
|
|
|
|
|
|
|
# Locate the cdl and expected directory
|
2014-09-19 08:26:06 +08:00
|
|
|
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
|
2014-12-29 13:42:05 +08:00
|
|
|
# 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
|
2010-07-30 04:37:05 +08:00
|
|
|
n3time \
|
2011-02-18 01:36:57 +08:00
|
|
|
ref_tst_chardata \
|
2013-09-24 07:08:50 +08:00
|
|
|
ref_tst_nul3 \
|
2014-09-19 08:26:06 +08:00
|
|
|
ref_tst_long_charconst \
|
|
|
|
tst_chararray \
|
2015-12-27 09:19:04 +08:00
|
|
|
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 \
|
2010-07-30 04:37:05 +08:00
|
|
|
ref_nctst_netcdf4_classic \
|
2012-01-10 02:49:15 +08:00
|
|
|
ref_tst_unlim2 \
|
2013-11-20 12:58:56 +08:00
|
|
|
ref_tst_names \
|
2012-01-10 02:49:15 +08:00
|
|
|
"
|
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
|
2014-12-29 13:42:05 +08:00
|
|
|
# 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 \
|
2011-01-27 05:58:03 +08:00
|
|
|
ref_tst_nans \
|
2011-02-18 01:36:57 +08:00
|
|
|
ref_solar \
|
2012-02-14 08:25:32 +08:00
|
|
|
unlimtest2 \
|
|
|
|
ref_tst_vlen_data \
|
|
|
|
ref_tst_vlen_data \
|
|
|
|
ref_tst_vlen_data2 \
|
2013-07-11 04:53:50 +08:00
|
|
|
ref_niltest \
|
|
|
|
ref_tst_h_scalar \
|
2013-09-24 07:08:50 +08:00
|
|
|
ref_tst_nul4 \
|
2012-02-14 08:25:32 +08:00
|
|
|
"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
|
|
|
SPECIALTESTS3="ref_tst_special_atts3"
|
|
|
|
|
2013-01-04 04:45:34 +08:00
|
|
|
SPECIALTESTS="${SPECIALTESTS3} ref_tst_special_atts"
|
2010-06-03 21:24:43 +08:00
|
|
|
|
2012-03-15 07:26:48 +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"
|
2013-09-21 10:31:21 +08:00
|
|
|
# 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 results
|
|
|
|
mkdir results
|