Skip to content

Commit

Permalink
Merge pull request #19 from ZOSOpenTools/test_infrastructure_update
Browse files Browse the repository at this point in the history
Update zopen_check_results to reflect new spec
  • Loading branch information
IgorTodorovskiIBM authored Sep 21, 2022
2 parents 13d8cf5 + 071e22d commit 3f1129e
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions buildenv
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,16 @@ fi

zopen_check_results()
{
# m4 check should have 4 (or 3) failures (3 if a git build)
# Determine number of failures by looking at testcases on line _after_ 'Failed checks were:' line
#
dir="$1"
pfx="$2"
chk="$1/$2_check.log"
chk="$2_check.log"

totalTests=$(cat "${chk}" | grep "^Checking .*" | wc -l)
start_line=$(cat "${chk}" | egrep -n '^Failed checks were:' | awk -F':' '{ print $1 }')
if [ $? -eq 0 ]; then
failures=$(cat "${chk}" | tail +${start_line} | head -2 | tail -1 | wc -w)
if [ ${failures} -eq 0 ]; then
return $ZOPEN_TEST_STATUS_ALL_PASSED
elif [ ${failures} -gt 4 ]; then
return $ZOPEN_TEST_STATUS_SOME_PASSED
else
return $ZOPEN_TEST_STATUS_MOST_PASSED
fi
fi
return $ZOPEN_TEST_STATUS_ERROR
failures=$(cat "${chk}" | tail +${start_line} | head -2 | tail -1 | wc -w)

cat <<ZZ
actualFailures:$failures
totalTests:$totalTests
expectedFailures:4
ZZ
}

0 comments on commit 3f1129e

Please sign in to comment.