summaryrefslogtreecommitdiff
path: root/gcc/testsuite/lib/gcov.exp
diff options
context:
space:
mode:
authormmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-27 23:53:08 +0000
committermmitchel <mmitchel@138bc75d-0d04-0410-961f-82ee72b054a4>2003-03-27 23:53:08 +0000
commitc375973417e761479df1b8911553ce742d886bec (patch)
tree2e5d7d573a5b7434c1a66870ae9f6c79faaea5d7 /gcc/testsuite/lib/gcov.exp
parent3e9fd48be053bec6f7eea5b5e28c9ab364100ca1 (diff)
downloadgcc-c375973417e761479df1b8911553ce742d886bec.tar.gz
* lib/gcov.exp (run-gcov): Add branches and calls options, rather
than reading .x files. * g++.dg/gcov/gcov-1.C: Use run-gcov options, not .x files. * g77.dg/gcov/gcov-1.f: Likewise. * gcc.misc-tests/gcov-4b.c: Likewise. * gcc.misc-tests/gcov-5b.c: Likewise. * gcc.misc-tests/gcov-6.c: Likewise. * gcc.misc-tests/gcov-7.c: Likewise. * gcc.misc-tests/gcov-8.c: Likewise. * g++.dg/gcov/gcov-1.x: Remove. * g77.dg/gcov/gcov-1.x: Likewise. * gcc.misc-tests/gcov-4b.x: Likewise. * gcc.misc-tests/gcov-5b.x: Likewise. * gcc.misc-tests/gcov-6.x: Likewise. * gcc.misc-tests/gcov-7.x: Likewise. * gcc.misc-tests/gcov-8.x: Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@64937 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/lib/gcov.exp')
-rw-r--r--gcc/testsuite/lib/gcov.exp43
1 files changed, 23 insertions, 20 deletions
diff --git a/gcc/testsuite/lib/gcov.exp b/gcc/testsuite/lib/gcov.exp
index 672156eb9ed..a6c70c4e42f 100644
--- a/gcc/testsuite/lib/gcov.exp
+++ b/gcc/testsuite/lib/gcov.exp
@@ -217,37 +217,40 @@ proc verify-calls { testcase file } {
# Called by dg-final to run gcov and analyze the results.
#
-# ARGS is the options to pass to gcov followed by the name of the
-# test source file.
+# ARGS consists of the optional strings "branches" and/or "calls",
+# (indicating that these things should be verified) followed by a
+# list of arguments to provide to gcov, including the name of the
+# source file.
proc run-gcov { args } {
global GCOV
global srcdir subdir
- # Extract the test name from the arguments.
- set testcase [lindex $args end]
+ set gcov_args [lindex $args end]
+
+ set gcov_verify_calls 0
+ set gcov_verify_branches 0
+ set gcov_execute_xfail ""
+ set gcov_verify_xfail ""
- # Get special options for this test from the .x script, if present.
- # This can include:
- # gcov_execute_xfail string to pass to setup_xfail
- # gcov_verify_xfail string to pass to setup_xfail
- # gcov_verify_branches if defined, check branch percentages
- # gcov_verify_calls if defined, check call return percentages
- if [file exists [file rootname $srcdir/$subdir/$testcase].x] {
- set done_p 0
- catch "set done_p \[source [file rootname $srcdir/$subdir/$testcase].x\]"
- if { $done_p } {
- return
+ foreach a $args {
+ if { $a == "calls" } {
+ set gcov_verify_calls 1
+ } elseif { $a == "branches" } {
+ set gcov_verify_branches 1
}
}
- if [info exists gcov_execute_xfail] {
+ # Extract the test name from the arguments.
+ set testcase [lindex $gcov_args end]
+
+ if { $gcov_execute_xfail != "" } {
eval setup_xfail [split $gcov_execute_xfail]
}
verbose "Running $GCOV $testcase" 2
set testcase [remote_download host $testcase];
- set result [remote_exec host $GCOV $args];
+ set result [remote_exec host $GCOV $gcov_args];
if { [lindex $result 0] != 0 } {
fail "$subdir/$testcase gcov failed: [lindex $result 1]"
clean-gcov $testcase
@@ -263,7 +266,7 @@ proc run-gcov { args } {
}
remote_upload host $testcase.gcov $testcase.gcov;
- if [info exists gcov_verify_xfail] {
+ if { $gcov_verify_xfail != "" } {
eval setup_xfail [split $gcov_verify_xfail]
}
@@ -272,12 +275,12 @@ proc run-gcov { args } {
# If requested via the .x file, check that branch and call information
# is correct.
- if [info exists gcov_verify_branches] {
+ if { $gcov_verify_branches } {
set bfailed [verify-branches $testcase $testcase.gcov]
} else {
set bfailed 0
}
- if [info exists gcov_verify_calls] {
+ if { $gcov_verify_calls } {
set cfailed [verify-calls $testcase $testcase.gcov]
} else {
set cfailed 0