ECC-197: Add test

This commit is contained in:
Shahram Najm 2015-12-22 16:53:02 +00:00
parent 3e27026750
commit 666cf140ca
6 changed files with 1616 additions and 0 deletions

View File

@ -11,6 +11,8 @@ STRING(REGEX REPLACE "\n" ";" bufr_files_to_download "${bufr_files_to_download}"
FILE(READ "bufr_ref_files.txt" bufr_refs_to_download)
STRING(REGEX REPLACE "\n" ";" bufr_refs_to_download "${bufr_refs_to_download}")
# Exceptional case: download bufr files which have to be treated specially
LIST(APPEND bufr_refs_to_download "vos308014_v3_26.bufr") # See test ecc-197
ecbuild_get_test_multidata(
TARGET eccodes_get_bufrs

View File

@ -47,6 +47,7 @@ list( APPEND tests2
bufr_filter
bufr_json
bufr_ls
ecc-197
gts_ls
metar_ls
metar_dump

1536
tests/ECC-197/element.table Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,38 @@
"308014" = [101000, 031000, 301018, 003001, 301093, 208032, 001079, 208000, 302062, 302063, 101000, 031000, 302092, 101000, 031000, 306033,
101000, 031000, 306034, 101000, 031000, 306043]
"301018" = [001114, 025185, 025186]
"301093" = [ 301036, 007030, 007031 ]
"302062" = [025188, 302001, 302093, 103000, 031000, 302053, 007032, 007033, 101000, 031000, 302004, 101000, 031001, 302005, 008002,
101000, 031000, 302055, 101000, 031000, 302056, 101000, 031000, 302021, 101000, 031000, 302024]
"302063" = [ 302038, 101000, 031000, 302040, 101000, 031000, 302034, 007032, 101000, 031000, 302058, 101000, 031000, 302064]
"301036" = [ 301003, 002001, 301011, 301012, 301023 ]
"301003" = [ 001011, 001012, 001013 ]
"301011" = [ 004001, 004002, 004003 ]
"301012" = [ 004004, 004005 ]
"301023" = [ 005002, 006002 ]
"302001" = [ 010004, 010051, 010061, 010063 ]
"302053" = [ 007032, 007033, 020001 ]
"302004" = [ 020010, 008002, 020011, 020013, 020012, 020012, 020012 ]
"302005" = [ 008002, 020011, 020012, 020013 ]
"302055" = [ 020031, 020032, 020033, 020034, 020035, 020036, 020037, 020038 ]
"302056" = [ 002038, 007063, 022043, 007063 ]
"302021" = [ 022001, 022011, 022021 ]
"302024" = [ 302022, 101002, 302023 ]
"302038" = [ 020003, 004024, 020004, 020005 ]
"302022" = [ 022002, 022012, 022022 ]
"302023" = [ 022003, 022013, 022023 ]
"302040" = [ 007032, 102002, 004024, 013011 ]
"302034" = [ 007032, 013023 ]
"302058" = [ 007032, 007033, 004024, 004024, 012111, 004024, 004024, 012112 ]
"302064" = [ 007032, 007033, 002002, 008021, 004025, 011001, 011002, 008021, 103000, 031001, 004025, 011043, 011041 ]
"306043" = [ 041001, 008043, 015028, 008043, 013080, 041005, 041003, 022188, 041002, 106000, 031000, 004024, 014002, 014002, 014012, 014004, 004024 ]
"302092" = [ 011104, 001012, 001013, 010038, 010039, 011007, 011008 ]
"302093" = [ 007032, 007033, 303099, 012101, 103000, 031000, 007032, 007033, 303099, 002039, 002097, 003024, 003021, 012102, 012103, 013003,
007032, 007033, 303099, 002039, 002097, 003021, 003024 ]
"303099" = [003005, 003006, 003007, 002096, 003022, 003003, 003020, 003004, 003023, 003008, 003009 ]
"302092" = [011104, 001012, 001013, 010038, 010039, 011007, 011008]
"302062" = [025188, 302001, 302093, 103000, 031000, 302053, 007032, 007033, 101000, 031000, 302004, 101000, 031001, 302005, 008002,
101000, 031000, 302055, 101000, 031000, 302056, 101000, 031000, 302021, 101000, 031000, 302024]
"306033" = [ 002033, 007063, 022064 ]
"306043" = [ 041001, 008043, 015028, 008043, 013080, 041005, 041003, 022188, 041002, 106000, 031000, 004024, 014002, 014002, 014012, 014004, 004024 ]
"306034" = [ 002031, 003010, 002040, 022005, 022032 ]

38
tests/ecc-197.sh Executable file
View File

@ -0,0 +1,38 @@
#!/bin/sh
# Copyright 2005-2015 ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities granted to it by
# virtue of its status as an intergovernmental organisation nor does it submit to any jurisdiction.
#
. ./include.sh
# ---------------------------------------------------------
# This is the test for the JIRA issue ECC-197.
# It tests decoding a BUFR file which cannot be done unless
# we extend the definitions to include extra files
# ---------------------------------------------------------
# Create a temporary directory which holds the tables etc
TEMP_DIR=ecc-197-temp-dir.$$
rm -rf $TEMP_DIR
mkdir -p $TEMP_DIR/definitions/bufr/tables/0/wmo/26
# Copy the definition files needed to decode BUFR file
def_files="${proj_dir}/tests/ECC-197/*"
for df in ${def_files}; do
cp -f $df $TEMP_DIR/definitions/bufr/tables/0/wmo/26
done
# Point ecCodes to look in this dir as well as standard one
MY_DEFS=`pwd`/$TEMP_DIR/definitions
export ECCODES_DEFINITION_PATH=$MY_DEFS:$ECCODES_DEFINITION_PATH
# Now decode
${tools_dir}bufr_dump ${data_dir}/bufr/vos308014_v3_26.bufr >/dev/null
rm -rf $TEMP_DIR

View File

@ -34,6 +34,7 @@ else
then
cd ../
cpath=`pwd`
proj_dir=$cpath
ECCODES_DEFINITION_PATH=$cpath/definitions
export ECCODES_DEFINITION_PATH
ECCODES_SAMPLES_PATH=$cpath/samples