# If we used the input files (so generally several times the same
# results in one section per target), we would incorreclty detect
# duplicates (as many as targets)
-grep -E '^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|UNSUPPORTED|UNTESTED|ERROR):' "$now_s" | uniq -cd > "$now_u"
-grep -E '^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|UNSUPPORTED|UNTESTED|ERROR):' "$before_s" | uniq -cd > "$before_u"
+EGREP="grep -E"
+
+if ! echo PASS | $EGREP '^(PASS|FAIL)' >/dev/null 2>&1; then
+ EGREP="egrep"
+fi
+
+$EGREP '^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|UNSUPPORTED|UNTESTED|ERROR):' "$now_s" | uniq -cd > "$now_u"
+$EGREP '^(PASS|XPASS|FAIL|XFAIL|UNRESOLVED|UNSUPPORTED|UNTESTED|ERROR):' "$before_s" | uniq -cd > "$before_u"
same_uniq=" now"
cmp -s "$before_u" "$now_u" && same_uniq=""
if [ -s "$before_u" -a "x$same_uniq" != "x" ]; then
echo "Changes to non-unique test names:"
- diff -u "$before_u" "$now_u" | grep -E '^[-\\+] '
+ diff -u "$before_u" "$now_u" | $EGREP '^[-\\+] '
echo
exit_status=1
fi