[llvm-commits] [hlvm] r38048 - /hlvm/trunk/test/lib/identity.exp

Reid Spencer reid at x10sys.com
Sat Jul 7 16:59:17 PDT 2007


Author: reid
Date: Sat Jul  7 18:59:17 2007
New Revision: 38048

URL: http://llvm.org/viewvc/llvm-project?rev=38048&view=rev
Log:
Retain the error output from the program and print it out if the execution
fails. This helps with seeing what went wrong with the program.

Modified:
    hlvm/trunk/test/lib/identity.exp

Modified: hlvm/trunk/test/lib/identity.exp
URL: http://llvm.org/viewvc/llvm-project/hlvm/trunk/test/lib/identity.exp?rev=38048&r1=38047&r2=38048&view=diff

==============================================================================
--- hlvm/trunk/test/lib/identity.exp (original)
+++ hlvm/trunk/test/lib/identity.exp Sat Jul  7 18:59:17 2007
@@ -44,17 +44,10 @@
   foreach test $files {
     set output [file join $outdir ${test}.out]
     set testsrc [file join $source $test]
-    set retval [ catch {exec $tool $testsrc -o $output } ]
+    set execout ""
+    set retval [ catch { exec -keepnewline $tool $testsrc -o $output } msg ]
     if { $retval == 1 } {
-      #Get output
-      if { [file exists $output] } {
-        set outputFile [open $output {RDONLY}]
-        set result [read $outputFile]
-        close $outputFile
-      } else {
-        set result "no output file"
-      }
-      fail "$test: $tool returned $retval\n$result"
+      fail "$test: $tool returned $retval\n$msg"
     } else {
       # Do the identity test
       set diffout [file join ${output}.diff]





More information about the llvm-commits mailing list