tmp2=$TMPDIR/$tool-testing.$$b
now_s=$TMPDIR/$tool-testing.$$d
before_s=$TMPDIR/$tool-testing.$$e
+now_u=$TMPDIR/$tool-uniq.$$d
+before_u=$TMPDIR/$tool-uniq.$$e
lst1=$TMPDIR/$tool-lst1.$$
lst2=$TMPDIR/$tool-lst2.$$
lst3=$TMPDIR/$tool-lst3.$$
lst5=$TMPDIR/$tool-lst5.$$
sum1=$TMPDIR/$tool-sum1.$$
sum2=$TMPDIR/$tool-sum2.$$
-tmps="$tmp1 $tmp2 $now_s $before_s $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2"
+tmps="$tmp1 $tmp2 $now_s $before_s $now_u $before_u $lst1 $lst2 $lst3 $lst4 $lst5 $sum1 $sum2"
[ "$1" = "-strict" ] && strict=$1 && shift
[ "$1" = "-?" ] && usage
sort -t ':' $skip1 "$now" > "$now_s"
sort -t ':' $skip1 "$before" > "$before_s"
+# Report non-unique test names, but print the two lists only if they
+# are different.
+sed '/^$/d' "$now_s" | uniq -cd > "$now_u"
+sed '/^$/d' "$before_s" | uniq -cd > "$before_u"
+
+same_uniq=" now"
+cmp -s "$before_u" "$now_u" && same_uniq=""
+
+if [ -s "$now_u" ]; then
+ echo "Non-unique test names$same_uniq: (Eeek!)"
+ cat "$now_u"
+ echo
+ exit_status=1
+fi
+
+if [ -s "$before_u" -a "x$same_uniq" != "x" ]; then
+ echo "Non-unique test names before: (Eeek!)"
+ cat "$before_u"
+ echo
+ exit_status=1
+fi
+
grep '^FAIL:' "$now_s" | sed 's/^[^:]*:[ ]//' >$tmp1
grep '^PASS' "$before_s" | sed 's/^[^:]*:[ ]//' | comm -12 $tmp1 - >$tmp2