Skip to content

Commit

Permalink
update scripts to call python unit test script instead of the old per…
Browse files Browse the repository at this point in the history
…l script
  • Loading branch information
georgemccabe committed May 2, 2024
1 parent d1d99b7 commit f08a52f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/jobs/run_unit_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ source ${MET_REPO_DIR}/.github/jobs/test_env_vars.sh
echo "Running MET unit tests..."
for testname in $TESTS_TO_RUN; do
CMD_LOGFILE=/met/logs/unit_${testname}.log
time_command ${MET_TEST_BASE}/perl/unit.pl ${MET_TEST_BASE}/xml/unit_${testname}.xml
time_command ${MET_TEST_BASE}/python/unit.py ${MET_TEST_BASE}/xml/unit_${testname}.xml
if [ $? != 0 ]; then
echo "ERROR: Unit test ${testname} failed"
cat /met/logs/unit_${testname}.log
Expand Down
14 changes: 7 additions & 7 deletions internal/test_unit/bin/unit_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ if [[ -z "${MET_TEST_MET_PYTHON_EXE}" ]] ; then
export MET_TEST_MET_PYTHON_EXE=/usr/local/python3/bin/python3
fi

PERL_UNIT_OPTS=""
UNIT_OPTS=""
for arg in $@; do
[ $arg == "-memchk" -o $arg == "memchk" ] && PERL_UNIT_OPTS="$PERL_UNIT_OPTS -memchk"
[ $arg == "-callchk" -o $arg == "callchk" ] && PERL_UNIT_OPTS="$PERL_UNIT_OPTS -callchk"
[ $arg == "-memchk" -o $arg == "memchk" ] && UNIT_OPTS="$UNIT_OPTS -memchk"
[ $arg == "-callchk" -o $arg == "callchk" ] && UNIT_OPTS="$UNIT_OPTS -callchk"
done

# Unit test script
PERL_UNIT=${MET_TEST_BASE}/perl/unit.pl
UNIT=${MET_TEST_BASE}/python/unit.py

# Unit test XML
UNIT_XML="unit_ascii2nc.xml \
Expand Down Expand Up @@ -107,15 +107,15 @@ UNIT_XML="${UNIT_XML} unit_ugrid.xml"
for CUR_XML in ${UNIT_XML}; do

echo
echo "CALLING: ${PERL_UNIT} $PERL_UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML}"
echo "CALLING: ${UNIT} $UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML}"
echo
${PERL_UNIT} $PERL_UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML}
${UNIT} $UNIT_OPTS ${MET_TEST_BASE}/xml/${CUR_XML}
RET_VAL=$?

# Fail on non-zero return status
if [ ${RET_VAL} != 0 ]; then
echo
echo "ERROR: ${PERL_UNIT} ${CUR_XML} failed."
echo "ERROR: ${UNIT} ${CUR_XML} failed."
echo
echo "*** UNIT TESTS FAILED ***"
echo
Expand Down

0 comments on commit f08a52f

Please sign in to comment.