Testing: add test for grib_compare with index files

This commit is contained in:
Shahram Najm 2020-03-29 21:51:18 +01:00
parent 57b9dabc52
commit c22264f19d
1 changed files with 15 additions and 1 deletions

View File

@ -50,11 +50,25 @@ EOF
diff $tempRef $tempOut diff $tempRef $tempOut
${tools_dir}/grib_index_build -k mars.levtype -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\ ${tools_dir}/grib_index_build -k mars.levtype -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\
grep -q "mars.levtype = { sfc, pl, pv, pt }" grep -q "mars.levtype = { sfc, pl, pv, pt }"
${tools_dir}/grib_index_build -k mars.levtype:i -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\ ${tools_dir}/grib_index_build -k mars.levtype:i -o $tempIndex ${data_dir}/tigge_cf_ecmwf.grib2 |\
grep -q "mars.levtype = { 103, 1, 106, 100, 101, 8, 109, 107 }" grep -q "mars.levtype = { 103, 1, 106, 100, 101, 8, 109, 107 }"
# grib_compare with index files
# -----------------------------
tempIndex1=temp.$$.1.idx
tempIndex2=temp.$$.2.idx
tempGribFile1=temp.index.$$.file1.grib
tempGribFile2=temp.index.$$.file2.grib
cat ${data_dir}/high_level_api.grib2 ${data_dir}/sample.grib2 > $tempGribFile1
cat ${data_dir}/sample.grib2 ${data_dir}/high_level_api.grib2 > $tempGribFile2
${tools_dir}/grib_index_build -o $tempIndex1 $tempGribFile1
${tools_dir}/grib_index_build -o $tempIndex2 $tempGribFile2
${tools_dir}/grib_compare $tempIndex1 $tempIndex2
rm -f $tempIndex1 $tempIndex2 $tempGribFile1 $tempGribFile2
# Clean up
rm -f $tempIndex $tempOut $tempRef rm -f $tempIndex $tempOut $tempRef