Add the line number where the script failed to the error output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35994 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Spencer 2007-04-14 16:41:39 +00:00
parent af6676df04
commit 520b487984

View File

@ -4,25 +4,27 @@ proc execOneLine { test outcome lineno line } {
set retval [ catch { eval exec -keepnewline -- $line } errmsg ] set retval [ catch { eval exec -keepnewline -- $line } errmsg ]
if { $retval != 0 } { if { $retval != 0 } {
set code [lindex $::errorCode 0] set code [lindex $::errorCode 0]
set lineno [expr $lineno + 1]
set errmsg " at RUN: line $lineno\nwhile running: $line\n$errmsg"
switch "$code" { switch "$code" {
CHILDSTATUS { CHILDSTATUS {
set status [lindex $::errorCode 2] set status [lindex $::errorCode 2]
if { $status ne 0 } { if { $status ne 0 } {
set resultmsg "$test: exit($status)\nwhile running: $line\n$errmsg" set resultmsg "$test: exit($status)$errmsg"
} }
} }
CHILDKILLED { CHILDKILLED {
set signal [lindex $::errorCode 2] set signal [lindex $::errorCode 2]
set resultmsg "$test: signal($signal)\nwhile running: $line\n$errmsg" set resultmsg "$test: signal($signal)$errmsg"
} }
CHILDSUSP { CHILDSUSP {
set signal [lindex $::errorCode 2] set signal [lindex $::errorCode 2]
set resultmsg "$test: suspend($signal)\nwhile running: $line\n$errmsg" set resultmsg "$test: suspend($signal)$errmsg"
} }
POSIX { POSIX {
set posixNum [lindex $::errorCode 1] set posixNum [lindex $::errorCode 1]
set posixMsg [lindex $::errorCode 2] set posixMsg [lindex $::errorCode 2]
set resultmsg "$test: posix($posixNum)\n$posixMsg\nwhile running: $line\n$errmsg" set resultmsg "$test: posix($posixNum,$posixMsg)$errmsg"
} }
NONE { NONE {
} }