diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7f36206d0..94bbc2882 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -160,7 +160,6 @@ if( HAVE_BUILD_TOOLS ) # and/or take much longer list(APPEND tests_extra grib_data_quality_checks - grib_repair grib_g1monthlydate grib_g1fcperiod grib_bpv_limit @@ -363,6 +362,10 @@ if( HAVE_BUILD_TOOLS ) TYPE SCRIPT CONDITION ECCODES_INSTALL_EXTRA_TOOLS COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_check_gaussian_grids.sh ) + ecbuild_add_test( TARGET eccodes_t_grib_repair + TYPE SCRIPT + CONDITION ECCODES_INSTALL_EXTRA_TOOLS AND ENABLE_EXTRA_TESTS + COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/grib_repair.sh ) # Note: making the test dependent on the grib files (with DEPENDS) diff --git a/tests/grib_repair.sh b/tests/grib_repair.sh index 794b75307..430fa89cb 100755 --- a/tests/grib_repair.sh +++ b/tests/grib_repair.sh @@ -14,14 +14,14 @@ label="grib_repair_test" tempText=temp.$label.txt tempGrib=temp.$label.grib -export ECCODES_GRIB_REPAIR_MAX_NUM_MESSAGES=3 +if [ -e "${tools_dir}/grib_repair" ]; then + export ECCODES_GRIB_REPAIR_MAX_NUM_MESSAGES=3 + ${tools_dir}/grib_repair $data_dir/bad.grib $tempGrib > $tempText 2>&1 + cat $tempText + ${tools_dir}/grib_ls $tempGrib -ls -l $data_dir/bad.grib -${tools_dir}/grib_repair $data_dir/bad.grib $tempGrib > $tempText 2>&1 -cat $tempText -${tools_dir}/grib_ls $tempGrib - -grep -q "Wrong message length" $tempText + grep -q "Wrong message length" $tempText +fi # Clean up rm -f $tempText $tempGrib