[llvm-commits] CVS: llvm/test/Programs/DiffOutput.sh Makefile.programs

Chris Lattner lattner at cs.uiuc.edu
Tue Apr 13 13:29:01 PDT 2004


Changes in directory llvm/test/Programs:

DiffOutput.sh updated: 1.15 -> 1.16
Makefile.programs updated: 1.125 -> 1.126

---
Log message:

Use spiff to perform our diffs.  This is nice for two reasons:
  1. We can eliminate the nasty code looking for gdiff/diff
  2. We can specify a tolerance that our FP numbers are allowed 
     to differ by, eliminating spurious failures in the testsuite.  :) :)


---
Diffs of the changes:  (+12 -17)

Index: llvm/test/Programs/DiffOutput.sh
diff -u llvm/test/Programs/DiffOutput.sh:1.15 llvm/test/Programs/DiffOutput.sh:1.16
--- llvm/test/Programs/DiffOutput.sh:1.15	Sun Jan 11 23:24:26 2004
+++ llvm/test/Programs/DiffOutput.sh	Tue Apr 13 13:28:12 2004
@@ -4,7 +4,7 @@
 #     DiffOutput.sh
 #
 # SYNOPSIS
-#     DiffOutput.sh <testtype> <testname> [<goodoutput>]
+#     DiffOutput.sh <diff&opts> <testtype> <testname> [<goodoutput>]
 #
 # DESCRIPTION
 #     DiffOutput.sh looks for a file named Output/<testname>.out-<testtype>
@@ -21,28 +21,18 @@
 #
 
 # Command line parameters:
-WHICHOUTPUT=$1
-PROG=$2
-GOODOUTPUT=${3-nat}
+DIFF=$1
+WHICHOUTPUT=$2
+PROG=$3
+GOODOUTPUT=${4-nat}
 # Output filename:
 DIFFOUTPUT=Output/${PROG}.diff-${WHICHOUTPUT}
 # Input filenames:
 TESTOUTPUT=Output/${PROG}.out-${WHICHOUTPUT}
 GOODOUTPUT=Output/${PROG}.out-${GOODOUTPUT}
 
-# Find gnu diff
-DIFF=diff
-if which gdiff > /dev/null 2>&1
-then
-  where=`which gdiff 2>&1`
-  if [ -x "$where" ]
-  then
-    DIFF=gdiff
-  fi
-fi
-
 # Diff the two files.
-$DIFF -u $GOODOUTPUT $TESTOUTPUT > $DIFFOUTPUT || (
+$DIFF $GOODOUTPUT $TESTOUTPUT > $DIFFOUTPUT || (
   # They are different!
   echo "******************** TEST ($WHICHOUTPUT) '$PROG' FAILED! ********************"
   echo "Execution Context Diff:"


Index: llvm/test/Programs/Makefile.programs
diff -u llvm/test/Programs/Makefile.programs:1.125 llvm/test/Programs/Makefile.programs:1.126
--- llvm/test/Programs/Makefile.programs:1.125	Sat Apr 10 11:53:06 2004
+++ llvm/test/Programs/Makefile.programs	Tue Apr 13 13:28:12 2004
@@ -55,8 +55,13 @@
 # TIMEPROG - The program used to get timing results for a program
 TIMEPROG := $(PROGDIR)/TimeProgram.sh
 
+TOLERANCEOPT :=
+ifdef FP_TOLERANCE
+TOLERANCEOPT := -r$(FP_TOLERANCE)
+endif
+
 # DIFFPROG - The program used to diff the output
-DIFFPROG := $(PROGDIR)/DiffOutput.sh
+DIFFPROG := $(PROGDIR)/DiffOutput.sh "$(LLVMTOOLCURRENT)/spiff $(TOLERANCEOPT)"
 
 # RUNTIMELIMIT - The number of seconds we should wait before certain events
 # timeout.  This is overridable on the commandline or in tests makefiles.





More information about the llvm-commits mailing list