diff options
author | Tom de Vries <tom@codesourcery.com> | 2015-02-26 18:24:56 +0000 |
---|---|---|
committer | Tom de Vries <vries@gcc.gnu.org> | 2015-02-26 18:24:56 +0000 |
commit | 3809f6458948459a466a559da99de6593bea1e83 (patch) | |
tree | 0de4acbf99e711f883a1b0c1f83cf222922a76a2 /gcc | |
parent | 70f6380da66bb6f0fa1372267dc83e8a119026ee (diff) | |
download | gcc-3809f6458948459a466a559da99de6593bea1e83.zip gcc-3809f6458948459a466a559da99de6593bea1e83.tar.gz gcc-3809f6458948459a466a559da99de6593bea1e83.tar.bz2 |
Add profopt-target-cleanup
2015-02-26 Tom de Vries <tom@codesourcery.com>
* lib/profopt.exp (profopt-target-cleanup): New proc.
(profopt-execute): Use profopt-target-cleanup to handle cleanup of
files from sources from dg-additional-sources.
From-SVN: r221024
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/testsuite/lib/profopt.exp | 37 |
2 files changed, 38 insertions, 5 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1211fab..c9789d9 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,11 @@ 2015-02-26 Tom de Vries <tom@codesourcery.com> + * lib/profopt.exp (profopt-target-cleanup): New proc. + (profopt-execute): Use profopt-target-cleanup to handle cleanup of + files from sources from dg-additional-sources. + +2015-02-26 Tom de Vries <tom@codesourcery.com> + * lib/gcov.exp: Cleanup in case of xfail. 2015-02-26 Sebastian Pop <s.pop@samsung.com> diff --git a/gcc/testsuite/lib/profopt.exp b/gcc/testsuite/lib/profopt.exp index 6c01a87..027ae9d 100644 --- a/gcc/testsuite/lib/profopt.exp +++ b/gcc/testsuite/lib/profopt.exp @@ -81,6 +81,30 @@ proc profopt-cleanup { testcase extlist } { } # +# profopt-target-cleanup -- remove profiling result files. +# +# DIR is the name of the directory +# TESTCASE is the name of the test +# EXT is the extensions of files to remove +# +proc profopt-target-cleanup { dir testcase ext } { + global additional_sources_used + set basename [file tail $testcase] + set base [file rootname $basename] + set file "$dir/$base.$ext" + eval "remote_file target delete $file" + + if [info exists additional_sources_used] { + foreach srcfile $additional_sources_used { + set basename [file tail $srcfile] + set base [file rootname $basename] + set file "$dir/$base.$ext" + eval "remote_file target delete $file" + } + } +} + +# # profopt-perf-value -- get performance value for a test # # TESTCASE is the name of the test @@ -262,10 +286,7 @@ proc profopt-execute { src } { remote_file build delete $execname3 verbose "Testing $testcase, $option" 1 - # Remove old profiling and performance data files. - foreach ext $prof_ext { - remote_file target delete $tmpdir/$base.$ext - } + # Remove old performance data files. if [info exists perf_ext] { profopt-cleanup $testcase $perf_ext } @@ -285,6 +306,12 @@ proc profopt-execute { src } { set extra_options [dg-additional-files-options "" "$src"] + # Remove old profiling data files. Make sure additional_sources_used is + # valid, by running it after dg-additional-files-options. + foreach ext $prof_ext { + profopt-target-cleanup $tmpdir $base $ext + } + # Tree profiling requires TLS runtime support, which may need # additional flags. if { [string first "-fprofile-generate" $profile_option] >= 0 } { @@ -368,7 +395,7 @@ proc profopt-execute { src } { # Remove the profiling data files. foreach ext $prof_ext { - remote_file target delete $tmpdir/$base.$ext + profopt-target-cleanup $tmpdir $base $ext } if { $status != "pass" } { |