From 285cec091dc55c165dd9e8f1bd3a53030c76e008 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Sat, 29 Apr 2023 12:44:25 +0100 Subject: [PATCH] Testing: cleanup --- examples/F90/bufr_get_string_array.sh | 20 ++++++-------------- examples/F90/bufr_read_header.sh | 2 +- examples/F90/bufr_read_scatterometer.sh | 8 ++------ examples/F90/bufr_read_temp.sh | 13 +++---------- examples/F90/bufr_subset.sh | 14 +++++++------- 5 files changed, 19 insertions(+), 38 deletions(-) diff --git a/examples/F90/bufr_get_string_array.sh b/examples/F90/bufr_get_string_array.sh index edfd86d20..463ce0d18 100755 --- a/examples/F90/bufr_get_string_array.sh +++ b/examples/F90/bufr_get_string_array.sh @@ -9,31 +9,23 @@ . ./include.ctest.sh -#Define a common label for all the tmp files +# Define a common label for all the tmp files label="bufr_get_string_array_test_f" -#Prepare tmp file +# Prepare tmp file fTmp=${label}.tmp.txt rm -f $fTmp -#----------------------------------------------------- +#---------------------------------------------------- # Test get string array from a BUFR #---------------------------------------------------- - fRef=${data_dir}/bufr/get_string_array.ref -REDIRECT=/dev/null - -#Write the values into a file and compare with reference +# Write the values into a file and compare with reference ${examples_dir}/eccodes_f_bufr_get_string_array > $fTmp -#We compare output to the reference by ignoring the whitespaces +# Compare output to the reference by ignoring the whitespaces diff -w $fRef $fTmp -#cat $fRes - -#Clean up +# Clean up rm -f ${fTmp} - - - diff --git a/examples/F90/bufr_read_header.sh b/examples/F90/bufr_read_header.sh index cb060d2b3..ee1172fcb 100755 --- a/examples/F90/bufr_read_header.sh +++ b/examples/F90/bufr_read_header.sh @@ -26,7 +26,7 @@ REDIRECT=/dev/null # Write the values into a file and compare with reference ${examples_dir}/eccodes_f_bufr_read_header $f 2> $REDIRECT > $fTmp -# Compare output to the reference by ignoring the whitespaces +# Compare output to the reference by ignoring the whitespaces diff -w $fRef $fTmp >$REDIRECT 2> $REDIRECT #Clean up diff --git a/examples/F90/bufr_read_scatterometer.sh b/examples/F90/bufr_read_scatterometer.sh index 8c80ac2b4..f69c2b8b8 100755 --- a/examples/F90/bufr_read_scatterometer.sh +++ b/examples/F90/bufr_read_scatterometer.sh @@ -10,7 +10,6 @@ . ./include.ctest.sh - # Define a common label for all the tmp files label="bufr_read_scatterometer_f" @@ -19,15 +18,12 @@ fTmp=${label}.tmp.txt rm -f $fTmp # We check "asca_139.bufr". The path is hardcoded in the example - -REDIRECT=/dev/null - # Write the key values into a file -${examples_dir}/eccodes_f_bufr_read_scatterometer 2> $REDIRECT > $fTmp +${examples_dir}/eccodes_f_bufr_read_scatterometer > $fTmp # Check the results REFERENCE_FILE=bufr_read_scatterometer_f.ref diff $REFERENCE_FILE $fTmp -#Clean up +# Clean up rm -f $fTmp diff --git a/examples/F90/bufr_read_temp.sh b/examples/F90/bufr_read_temp.sh index bc9184197..810fb4cb6 100755 --- a/examples/F90/bufr_read_temp.sh +++ b/examples/F90/bufr_read_temp.sh @@ -10,22 +10,15 @@ . ./include.ctest.sh - -#Define a common label for all the tmp files +# Define a common label for all the tmp files label="bufr_read_temp_f" -#Define tmp file fTmp=${label}.tmp.txt rm -f $fTmp # The path to the BUFR file is hardcoded in the example - -REDIRECT=/dev/null - -# Run the example ${examples_dir}/eccodes_f_bufr_read_temp > $fTmp +grep -q 'timePeriod pressure geopotentialHeight' $fTmp -#TODO: check the results - -#Clean up +# Clean up rm -f $fTmp diff --git a/examples/F90/bufr_subset.sh b/examples/F90/bufr_subset.sh index 3c2571444..1ae3e5ad4 100755 --- a/examples/F90/bufr_subset.sh +++ b/examples/F90/bufr_subset.sh @@ -10,15 +10,15 @@ . ./include.ctest.sh -#Define a common label for all the tmp files +# Define a common label for all the tmp files label="bufr_subset_test_f" -#Prepare tmp file +# Prepare tmp file fTmp=${label}.tmp.txt fTmp2=${label}.tmp2.txt rm -f $fTmp -#Prepare ref file +# Prepare ref file fRef=${label}.ref cat > $fRef < $fRef < $REDIRECT > $fTmp # Remove blank lines sed '/^\s*$/d' < $fTmp > $fTmp2 -#We compare output to the reference by ignoring the whitespaces +# We compare output to the reference by ignoring the whitespaces diff -w $fRef $fTmp2 >$REDIRECT 2> $REDIRECT #Clean up