mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-08-17 05:29:24 +00:00
For PR1319:
More improvements: 1. Using ::errorInfo wasn't such a hot idea. Go back to just printing the offending line of code and the stderr output. This is sufficient and not entangled with Tcl goop. 2. Capture the problem report numbers and report them whether pass or fail. This helps quickly get some context when a test fails, if it has an associated PR number. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36010 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
4b3fd6c010
commit
90016c7939
@ -1,11 +1,14 @@
|
|||||||
proc execOneLine { test outcome lineno line } {
|
proc execOneLine { test PRS outcome lineno line } {
|
||||||
set status 0
|
set status 0
|
||||||
set resultmsg ""
|
set resultmsg ""
|
||||||
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 lineno [expr $lineno + 1]
|
||||||
set errmsg " at RUN: line $lineno\n$::errorInfo"
|
if { $PRS != ""} {
|
||||||
|
set PRS " for $PRS"
|
||||||
|
}
|
||||||
|
set errmsg " at line $lineno$PRS\nwhile running: $line\n$errmsg"
|
||||||
switch "$code" {
|
switch "$code" {
|
||||||
CHILDSTATUS {
|
CHILDSTATUS {
|
||||||
set status [lindex $::errorCode 2]
|
set status [lindex $::errorCode 2]
|
||||||
@ -96,19 +99,34 @@ proc llvm-runtest { programs } {
|
|||||||
# Open the test file and start reading lines
|
# Open the test file and start reading lines
|
||||||
set testFileId [ open $test r]
|
set testFileId [ open $test r]
|
||||||
set runline ""
|
set runline ""
|
||||||
|
set PRNUMS ""
|
||||||
foreach line [split [read $testFileId] \n] {
|
foreach line [split [read $testFileId] \n] {
|
||||||
|
|
||||||
#see if this is our run line
|
# if its the END. line then stop parsing (optimization for big files)
|
||||||
if {[regexp {END.[ *]$} $line match endofscript]} {
|
if {[regexp {END.[ *]$} $line match endofscript]} {
|
||||||
break
|
break
|
||||||
|
|
||||||
|
# if the line is continued, concatente and continue the loop
|
||||||
} elseif {[regexp {RUN: *([^\\]+)(\\)$} $line match oneline suffix]} {
|
} elseif {[regexp {RUN: *([^\\]+)(\\)$} $line match oneline suffix]} {
|
||||||
set runline "$runline$oneline "
|
set runline "$runline$oneline "
|
||||||
|
|
||||||
|
# if its a terminating RUN: line then do substitution on the whole line
|
||||||
|
# and then save the line.
|
||||||
} elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} {
|
} elseif {[regexp {RUN: *([^&]+)(&&)?} $line match oneline suffix]} {
|
||||||
set runline "$runline$oneline"
|
set runline "$runline$oneline"
|
||||||
set runline [ substitute $runline $test $tmpFile ]
|
set runline [ substitute $runline $test $tmpFile ]
|
||||||
set lines($numLines) $runline
|
set lines($numLines) $runline
|
||||||
set numLines [expr $numLines + 1]
|
set numLines [expr $numLines + 1]
|
||||||
set runline ""
|
set runline ""
|
||||||
|
|
||||||
|
# if its an PR line, save the problem report number
|
||||||
|
} elseif {[regexp {PR([0-9]+)} $line match prnum]} {
|
||||||
|
if {$PRNUMS == ""} {
|
||||||
|
set PRNUMS $prnum
|
||||||
|
} else {
|
||||||
|
set PRNUMS "$PRNUMS,$prnum"
|
||||||
|
}
|
||||||
|
# if its an XFAIL line, see if we should be XFAILing or not.
|
||||||
} elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} {
|
} elseif {[regexp {XFAIL:[ *](.+)} $line match targets]} {
|
||||||
set targets
|
set targets
|
||||||
|
|
||||||
@ -138,7 +156,7 @@ proc llvm-runtest { programs } {
|
|||||||
for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } {
|
for { set i 0 } { $i < $numLines } { set i [ expr $i + 1 ] } {
|
||||||
regsub ^.*RUN:(.*) $lines($i) \1 theLine
|
regsub ^.*RUN:(.*) $lines($i) \1 theLine
|
||||||
set theLine [subst $theLine ]
|
set theLine [subst $theLine ]
|
||||||
set resultmsg [execOneLine $test $outcome $i $theLine ]
|
set resultmsg [execOneLine $test $PRNUMS $outcome $i $theLine ]
|
||||||
if { $resultmsg != "" } {
|
if { $resultmsg != "" } {
|
||||||
if { $outcome == "XFAIL" } {
|
if { $outcome == "XFAIL" } {
|
||||||
xfail "$resultmsg"
|
xfail "$resultmsg"
|
||||||
@ -150,10 +168,13 @@ proc llvm-runtest { programs } {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if { !$failed } {
|
if { !$failed } {
|
||||||
|
if {$PRNUMS != ""} {
|
||||||
|
set PRNUMS " for $PRNUMS"
|
||||||
|
}
|
||||||
if { $outcome == "XFAIL" } {
|
if { $outcome == "XFAIL" } {
|
||||||
xpass "$test"
|
xpass "$test$PRNUMS"
|
||||||
} else {
|
} else {
|
||||||
pass "$resultmsg"
|
pass "$test$PRNUMS"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user