diff options
author | Tom Tromey <tromey@redhat.com> | 2013-08-13 15:55:52 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2013-08-13 15:55:52 +0000 |
commit | 17e1c970ef41149e5eb6b5f908301e6a86a7f528 (patch) | |
tree | 23b999d13e17d616ef89dcc37aab806ca63973d4 /gdb/testsuite/lib/cell.exp | |
parent | 4e2348988f2e09ced290e012981de941c96bc70c (diff) | |
download | gdb-17e1c970ef41149e5eb6b5f908301e6a86a7f528.zip gdb-17e1c970ef41149e5eb6b5f908301e6a86a7f528.tar.gz gdb-17e1c970ef41149e5eb6b5f908301e6a86a7f528.tar.bz2 |
add caching procs to test suite
In the fully parallel mode, each .exp file can be run in parallel (at
least conceptually -- the actual split may not be so severe). This
means that procs that compute a result and cache it are not going to
function very well. The test they run will be invoked over and over.
This patch introduces a generic caching mechanism and changes various
result-caching procs to use it. This is a cleanup to introduce the
basic change; the results aren't written to disk yet.
A caching proc is defined using gdb_caching_proc, which works like
"proc", except that it caches the result of the body.
* lib/cache.exp: New file.
* lib/cell.exp (skip_cell_tests): Use gdb_caching_proc.
* lib/gdb.exp: Load cache.exp.
(support_complex_tests, is_ilp32_target, is_lp64_target)
(is_amd64_regs_target, skip_altivec_tests, skip_vsx_tests)
(gdb_skip_xml_test): Use gdb_caching_proc.
* lib/opencl.exp (skip_opencl_tests): Use gdb_caching_proc.
Diffstat (limited to 'gdb/testsuite/lib/cell.exp')
-rw-r--r-- | gdb/testsuite/lib/cell.exp | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/gdb/testsuite/lib/cell.exp b/gdb/testsuite/lib/cell.exp index e799b7f..9a20f5c 100644 --- a/gdb/testsuite/lib/cell.exp +++ b/gdb/testsuite/lib/cell.exp @@ -70,16 +70,10 @@ proc gdb_cell_embedspu {source dest options} { # Run a test on the target to see if it supports Cell/B.E. hardware. # Return 0 if so, 1 if it does not. -proc skip_cell_tests {} { - global skip_cell_tests_saved +gdb_caching_proc skip_cell_tests { global srcdir subdir gdb_prompt inferior_exited_re - # Use the cached value, if it exists. set me "skip_cell_tests" - if [info exists skip_cell_tests_saved] { - verbose "$me: returning saved $skip_cell_tests_saved" 2 - return $skip_cell_tests_saved - } # Set up, compile, and execute a combined Cell/B.E. test program. # Include the current process ID in the file names to prevent conflicts @@ -125,7 +119,7 @@ proc skip_cell_tests {} { file delete $exe_spu-embed.o if { $skip } { - return [set skip_cell_tests_saved 1] + return 1 } # Compilation succeeded so now run it via gdb. @@ -138,22 +132,22 @@ proc skip_cell_tests {} { gdb_expect { -re ".*$inferior_exited_re normally.*${gdb_prompt} $" { verbose -log "\n$me: Cell/B.E. hardware detected" - set skip_cell_tests_saved 0 + set result 0 } -re ".*$inferior_exited_re with code.*${gdb_prompt} $" { verbose -log "\n$me: Cell/B.E. hardware not detected" - set skip_cell_tests_saved 1 + set result 1 } default { verbose -log "\n$me Cell/B.E. hardware not detected (default case)" - set skip_cell_tests_saved 1 + set result 1 } } gdb_exit remote_file build delete $exe - verbose "$me: returning $skip_cell_tests_saved" 2 - return $skip_cell_tests_saved + verbose "$me: returning $result" 2 + return $result } # Delete all breakpoints and stop on the next new SPU thread |