aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--lib/dg.exp31
2 files changed, 27 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 04d1aa0..25102ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/lib/dg.exp b/lib/dg.exp
index ca11538..78a23f1 100644
--- a/lib/dg.exp
+++ b/lib/dg.exp
@@ -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