1#!/bin/sh
2
3if test "x$srcdir" = x ; then srcdir=`pwd`; fi
4. ../test_common.sh
5
6# To add a new test,
7# 1. put the .cdl file in the 'cdl' directory
8# 2. put the result of running ncgen then ncdump
9#    into the directory 'expected' as .dmp
10# 3. Modify the file tst_ncgen_shared.sh to add
11#    the test to the end of the TESTS4 variable
12#    or CLASSIC variable.
13# 4. Add the new files into cdl/Makfile.am
14#    and expected/Makefile.am
15
16set -e
17RESULTSDIR="./results_$$"
18#SHOWXFAILS=1
19
20# Locate the cdl and expected directory
21cdl="${srcdir}/cdl"
22expected="${srcdir}/expected"
23
24case "x${KFLAG}" in
25x1) CLASSIC=1; MODE=3;;
26x2) CLASSIC=1; MODE=3;;
27x3) CLASSIC=0; MODE=4;;
28x4) CLASSIC=1; MODE=3;;
29*) echo "illegal KFLAG" ; exit 1;;
30esac
31
32# Define the set of tests that can be
33# processed with either the -k nc3 or -k nc4 or -k nc7 flag
34
35# The netcdf-3 tests are divided into two parts
36# These test can be run when --enable-netcdf-4 is false
37CLASSIC3="\
38nc_enddef \
39ref_tst_unicode \
40ref_tst_utf8 \
41simple_xy \
42small \
43nc_sync \
44ref_tst_small \
45small2 \
46tst_ncml
47n3time \
48ref_tst_chardata \
49ref_tst_nul3 \
50ref_tst_long_charconst \
51tst_chararray \
52unlimtest1 \
53ref_keyword"
54
55NONCLASSIC3="\
56test0 \
57sfc_pres_temp \
58fills \
59c0 \
60example_good \
61pres_temp_4D \
62ref_nctst \
63ref_nctst_64bit_offset \
64ref_ctest1_nc4 \
65ref_ctest1_nc4c \
66ref_nctst_netcdf4 \
67ref_nctst_netcdf4_classic \
68ref_tst_unlim2 \
69ref_tst_names \
70"
71
72if test "${CLASSIC}" = "1" ; then
73TESTS3="${CLASSIC3}"
74else
75TESTS3="${CLASSIC3} ${NONCLASSIC3}"
76fi
77
78# Define the set of tests that must be
79# processed with the -k nc4 flag
80
81TESTS4="\
82ref_dimscope \
83ref_typescope \
84ref_tst_string_data \
85ref_tst_comp \
86ref_tst_comp2 \
87ref_tst_comp3 \
88ref_tst_group_data \
89ref_tst_opaque_data \
90ref_tst_solar_1 \
91ref_tst_solar_2 \
92ref_tst_enum_data \
93ref_tst_special_atts \
94ref_tst_nans \
95ref_solar \
96unlimtest2 \
97ref_niltest \
98ref_tst_h_scalar \
99ref_tst_nul4 \
100"
101
102if test "x$NC_VLEN_NOTEST" = x ; then
103TESTS4="$TESTS4 ref_tst_vlen_data ref_tst_vlen_data2"
104fi
105
106SPECIALTESTS3="ref_tst_special_atts3"
107
108SPECIALTESTS="${SPECIALTESTS3} ref_tst_special_atts"
109
110XFAILTESTS=""
111# Fails because ncdump does not output multiple unlim char types correctly
112XFAILTESTS="ref_tst_unlim2 $XFAILTESTS"
113# Fails because ?
114XFAILTESTS="ref_const_test $XFAILTESTS"
115# Fails because ?
116XFAILTESTS="ref_tst_chardata $XFAILTESTS"
117# Fails because ncdump is crashing
118#XFAILTESTS="ref_tst_econst $XFAILTESTS"
119
120# Following are generally not run
121# Because of the size of their output
122BIGTESTS3="\
123bigf1 \
124bigf2 \
125bigr1 \
126bigr2"
127
128# Following deliberately produces a very large
129# file: too large for netcdf to handle
130# Currently not used because of space and time
131# constraints
132XFAILBIG="bigf3"
133
134BIGTESTS4="ref_tst_solar_1"
135
136# This test is both big and slow
137# File was too large to reasonably include
138# so I removed it
139#BIGBIG3="gfs1"
140
141BIGTESTS="${BIGTESTS3} ${BIGTESTS4} ${BIGBIG3}"
142
143failcount=0
144passcount=0
145xfailcount=0
146
147rm -fr $RESULTSDIR
148