diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rwxr-xr-x | contrib/sum2junit.sh | 12 |
2 files changed, 10 insertions, 6 deletions
@@ -1,3 +1,7 @@ +2018-07-20 Ben Elliston <bje@gnu.org> + + * contrib/sum2junit.sh: Eliminate some Shellcheck warnings. + 2018-07-19 Ben Elliston <bje@gnu.org> * runtest: Use POSIX 'command', not 'type', to look for the Expect diff --git a/contrib/sum2junit.sh b/contrib/sum2junit.sh index 8ef6347..7d3b0a4 100755 --- a/contrib/sum2junit.sh +++ b/contrib/sum2junit.sh @@ -34,19 +34,19 @@ fi tool=$(grep "tests ===" "$infile" | tr -s ' ' | cut -d ' ' -f 2) # Get the counts for tests that didn't work properly -skipped=$(egrep -c '^UNRESOLVED|^UNTESTED|^UNSUPPORTED' "$infile") +skipped=$(grep -E -c '^UNRESOLVED|^UNTESTED|^UNSUPPORTED' "$infile") if test x"${skipped}" = x; then skipped=0 fi # The total of successful results are PASS and XFAIL -passes=$(egrep -c '^PASS|XFAIL' "$infile") +passes=$(grep -E -c '^PASS|XFAIL' "$infile") if test x"${passes}" = x; then passes=0 fi # The total of failed results are FAIL and XPASS -failures=$(egrep -c '^XFAIL|XPASS' "$infile") +failures=$(grep -E -c '^XFAIL|XPASS' "$infile") if test x"${failures}" = x; then failures=0 fi @@ -55,7 +55,7 @@ fi total=$((passes + failures)) total=$((total + skipped)) -cat <<EOF > ${outfile} +cat <<EOF > "$outfile" <?xml version="1.0"?> <testsuites> @@ -68,9 +68,9 @@ EOF # case problem results. tmpfile="${infile}.tmp" rm -f "$tmpfile" -egrep 'XPASS|FAIL|UNTESTED|UNSUPPORTED|UNRESOLVED' "$infile" > "$tmpfile" +grep -E 'XPASS|FAIL|UNTESTED|UNSUPPORTED|UNRESOLVED' "$infile" > "$tmpfile" -while read line +while read -r line do echo -n "." result=$(echo "$line" | cut -d ' ' -f 1 | tr -d ':') |