mirror of https://github.com/ecmwf/eccodes.git
Testing: codes_parser
This commit is contained in:
parent
209a990bf4
commit
f4e724a95b
|
@ -8,10 +8,11 @@
|
||||||
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
|
||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
. ./include.ctest.sh
|
. ./include.ctest.sh
|
||||||
|
|
||||||
|
label="definitions_test"
|
||||||
REDIRECT=/dev/null
|
REDIRECT=/dev/null
|
||||||
|
tempOut=temp.$label.txt
|
||||||
|
|
||||||
[ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d`
|
[ -z "$ECCODES_DEFINITION_PATH" ] || ECCODES_DEFINITION_PATH=`${tools_dir}/codes_info -d`
|
||||||
|
|
||||||
|
@ -19,3 +20,13 @@ for file in `find ${ECCODES_DEFINITION_PATH}/ -name '*.def' -print | grep -v gri
|
||||||
do
|
do
|
||||||
${tools_dir}/codes_parser $file > $REDIRECT
|
${tools_dir}/codes_parser $file > $REDIRECT
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Try an invalid input
|
||||||
|
set +e
|
||||||
|
echo 'transient xx=1' | ${tools_dir}/codes_parser - 2>$tempOut
|
||||||
|
status=$?
|
||||||
|
set -e
|
||||||
|
[ $status -ne 0 ]
|
||||||
|
grep -q "Parser: syntax error" $tempOut
|
||||||
|
|
||||||
|
rm -f $tempOut
|
||||||
|
|
|
@ -21,6 +21,7 @@ int main(int argc, char* argv[])
|
||||||
for (i = 1; i < argc; i++) {
|
for (i = 1; i < argc; i++) {
|
||||||
printf("%s ... ", argv[i]);
|
printf("%s ... ", argv[i]);
|
||||||
fflush(stdout);
|
fflush(stdout);
|
||||||
|
// argv can be "-" to indicate stdin
|
||||||
if (!(a = grib_parse_file(c, argv[i]))) {
|
if (!(a = grib_parse_file(c, argv[i]))) {
|
||||||
fail++;
|
fail++;
|
||||||
printf("FAILED\n");
|
printf("FAILED\n");
|
||||||
|
|
Loading…
Reference in New Issue