Testing: Run bufr_dump -Epython

This commit is contained in:
Shahram Najm 2023-08-14 12:45:52 +01:00
parent d4d81deea2
commit 8509443968
3 changed files with 17 additions and 18 deletions

View File

@ -318,6 +318,8 @@ if( HAVE_BUILD_TOOLS )
list(APPEND tests_extra grib_tigge_conversions2)
list(APPEND tests_extra bufr_dump_encode_C)
list(APPEND tests_extra bufr_dump_decode_C)
list(APPEND tests_extra bufr_dump_encode_python)
list(APPEND tests_extra bufr_dump_decode_python)
list(APPEND tests_extra list_codetable_flagtable_keys)
endif()

View File

@ -21,8 +21,6 @@ tempDir=temp.${label}.dir
mkdir -p $tempDir
cd $tempDir
echo "PYTHONPATH set to $PYTHONPATH"
bufr_files=`cat ${data_dir}/bufr/bufr_data_files.txt`
for file in ${bufr_files}
@ -38,9 +36,9 @@ do
# Generate Python code from BUFR file
${tools_dir}/bufr_dump -Dpython $inputBufr > $tempSrc
if test "x$PYTHON" != "x"; then
$PYTHON $tempSrc $inputBufr
fi
# if test "x$PYTHON" != "x"; then
# $PYTHON $tempSrc $inputBufr
# fi
rm -f $tempSrc
done

View File

@ -39,21 +39,20 @@ do
#pylint --disable=E0602,R,C,W $tempSrc
# if test "x$PYTHON" != "x"; then
# # The python code always creates an output file called outfile.bufr
# $PYTHON $tempSrc
if test "x$PYTHON" != "x"; then
# The python code always creates an output file called outfile.bufr
$PYTHON $tempSrc
# # Check original BUFR file against one we generated from sample
# ${tools_dir}/bufr_compare $inputBufr $tempBufr
# Check original BUFR file against one we generated from sample
${tools_dir}/bufr_compare $inputBufr $tempBufr
TEMP_OUT1=${label}.$file.dump.out
TEMP_OUT2=${label}.$tempBufr.dump.out
${tools_dir}/bufr_dump -p $inputBufr > $TEMP_OUT1
${tools_dir}/bufr_dump -p $tempBufr > $TEMP_OUT2
diff $TEMP_OUT1 $TEMP_OUT2
rm -f $TEMP_OUT1 $TEMP_OUT2
fi
# TEMP_OUT1=${label}.$file.dump.out
# TEMP_OUT2=${label}.$tempBufr.dump.out
# ${tools_dir}/bufr_dump -p $inputBufr > $TEMP_OUT1
# ${tools_dir}/bufr_dump -p $tempBufr > $TEMP_OUT2
# diff $TEMP_OUT1 $TEMP_OUT2
# rm -f $TEMP_OUT1 $TEMP_OUT2
# fi
rm -f $tempSrc $tempBufr
done