diff options
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | lib/dg.exp | 31 |
2 files changed, 27 insertions, 8 deletions
@@ -2,6 +2,10 @@ PR58065 + * lib/dg.exp (dg-test): Store results of analyzing messages in a + list, then report them to the framework after giving the pruning + callback an opportunity to skip the test case. + * testsuite/runtest.libs/dg.test: Add tests for skipping tests based on special result codes from mock-dg-prune. (mock-dg-test): Add directive for output text. @@ -698,6 +698,7 @@ proc dg-test { args } { set comp_output [lindex $results 0] set output_file [lindex $results 1] + # Store an analysis of the messages produced. foreach i ${dg-messages} { verbose "Scanning for message: $i" 4 @@ -720,28 +721,36 @@ proc dg-test { args } { scan $line ${dg-linenum-format} line switch -- [lindex $i 1] { "ERROR" { - $ok "$name $comment (test for errors, line $line)" + lappend scan_results $ok \ + "$name $comment (test for errors, line $line)" } "XERROR" { - x$ok "$name $comment (test for errors, line $line)" + lappend scan_results x$ok \ + "$name $comment (test for errors, line $line)" } "WARNING" { - $ok "$name $comment (test for warnings, line $line)" + lappend scan_results $ok \ + "$name $comment (test for warnings, line $line)" } "XWARNING" { - x$ok "$name $comment (test for warnings, line $line)" + lappend scan_results x$ok \ + "$name $comment (test for warnings, line $line)" } "BOGUS" { - $uhoh "$name $comment (test for bogus messages, line $line)" + lappend scan_results $uhoh \ + "$name $comment (test for bogus messages, line $line)" } "XBOGUS" { - x$uhoh "$name $comment (test for bogus messages, line $line)" + lappend scan_results x$uhoh \ + "$name $comment (test for bogus messages, line $line)" } "BUILD" { - $uhoh "$name $comment (test for build failure, line $line)" + lappend scan_results $uhoh \ + "$name $comment (test for build failure, line $line)" } "XBUILD" { - x$uhoh "$name $comment (test for build failure, line $line)" + lappend scan_results x$uhoh \ + "$name $comment (test for build failure, line $line)" } "EXEC" { } "XEXEC" { } @@ -772,6 +781,12 @@ proc dg-test { args } { } } + # Report the results of the message analysis. + if { [info exists scan_results] } { + foreach { result message } $scan_results { $result $message } + unset scan_results + } + # See if someone forgot to delete the extra lines. regsub -all "\n+" $comp_output "\n" comp_output regsub "^\n+" $comp_output "" comp_output |