Skip to content

Commit

Permalink
Add (and check) check metadata file
Browse files Browse the repository at this point in the history
  • Loading branch information
Steve Goldhaber committed Feb 15, 2025
1 parent ed31686 commit ac67b47
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
22 changes: 22 additions & 0 deletions test/test_fortran_to_metadata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,25 @@ sample_meta="${sample_files}/check_fortran_to_metadata.meta"
# Run the script
opts="--ddt-names serling_t"
${f2m_script} --output-root "${tmp_dir}" ${opts} "${test_input}"
res=$?

retval=0
if [ ${res} -ne 0 ]; then
echo "FAIL: ccpp_fortran_to_metadata.py exited with error ${res}"
retval=${res}
elif [ ! -f "${tmp_dir}/${filename}.meta" ]; then
echo "FAIL: metadata file, '${tmp_dir}/${filename}.meta', not created"
retval=1
else
cmp --quiet "${sample_meta}" "${tmp_dir}/${filename}.meta"
res=$?
if [ ${res} -ne 0 ]; then
echo "FAIL: Comparison with correct metadata file failed"
retval=${res}
else
echo "PASS"
# Cleanup
rm "${tmp_dir}/${filename}.meta"
fi
fi
exit ${retval}
31 changes: 31 additions & 0 deletions test/unit_tests/sample_files/check_fortran_to_metadata.meta
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[ccpp-table-properties]
name = do_stuff
type = scheme

[ccpp-arg-table]
name = do_stuff_run
type = scheme
[ const_props ]
standard_name = enter_standard_name_1
units = enter_units
type = ccpp_constituent_prop_ptr_t
dimensions = (enter_standard_name_5:enter_standard_name_6)
intent = in
[ twilight_zone ]
standard_name = enter_standard_name_2
units = enter_units
type = serling_t
dimensions = ()
intent = inout
[ errmsg ]
standard_name = enter_standard_name_3
units = enter_units
type = character | kind = len=512
dimensions = ()
intent = out
[ errflg ]
standard_name = enter_standard_name_4
units = enter_units
type = integer
dimensions = ()
intent = out

0 comments on commit ac67b47

Please sign in to comment.