changelog: fix parsing of a revert commit
[gcc.git] / contrib / dg-cmp-results.sh
index 5f2fed5ec3ff0c66d22bc07c84571568730fbcac..eb976f68f4ac6800fca67c48bb6b3466f6213604 100755 (executable)
@@ -63,6 +63,7 @@ OFILE="$2"
 OBASE=`basename "$2"`
 NFILE="$3"
 NBASE=`basename "$3"`
+TMPDIR=${TMPDIR:-/tmp}
 
 echo "dg-cmp-results.sh: Verbosity is ${verbose}, Variant is \"${VARIANT}\""
 echo
@@ -97,7 +98,7 @@ sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
   -e 's/^/O:/' \
   $OFILE |
   sort -s -t : -k 3b - \
-  >/tmp/o$$-$OBASE
+  >$TMPDIR/o$$-$OBASE
 
 # Create a temporary file from the new file's interesting section.
 sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
@@ -107,7 +108,7 @@ sed $E -e "/$header/,/^[[:space:]]+===.*Summary ===/!d" \
   -e 's/^/N:/' \
   $NFILE |
   sort -s -t : -k 3b - \
-  >/tmp/n$$-$NBASE
+  >$TMPDIR/n$$-$NBASE
 
 # Merge the two files, then compare adjacent lines.
 # Comparison is complicated by tests that may be run multiple times.
@@ -136,8 +137,11 @@ function drop() {
 function compare(st, nm) {
     old = peek()
     if (old == 0) {
-        # This new test wasn't run last time.
-        if (verbose >= 2) printf("NA->%s:%s\n", st, nm)
+       # This new test wasn't run last time.
+       if(st == "FAIL" || st == "UNRESOLVED" || verbose >= 2) {
+           # New test fails or we want all changes
+           printf("NA->%s:%s\n", st, nm)
+       }
     }
     else {
        # Compare this new test to the first queued old one.
@@ -200,10 +204,10 @@ END {
     while (old = peek()) compare("", "")
 }
 EOF
-sort -m -s -t : -k 3b /tmp/o$$-$OBASE /tmp/n$$-$NBASE |
+sort -m -s -t : -k 3b $TMPDIR/o$$-$OBASE $TMPDIR/n$$-$NBASE |
  awk -v verbose=$verbose -f compare-$$.awk /dev/stdin
 
 # Delete the temporary files.
-rm -f compare-$$.awk /tmp/o$$-$OBASE /tmp/n$$-$NBASE
+rm -f compare-$$.awk $TMPDIR/o$$-$OBASE $TMPDIR/n$$-$NBASE
 
 exit 0