diff options
author | Tom Tromey <tromey@redhat.com> | 2012-07-10 14:41:16 +0000 |
---|---|---|
committer | Tom Tromey <tromey@redhat.com> | 2012-07-10 14:41:16 +0000 |
commit | 686f09d02169f2e74f4465ed61f5be6f6664749b (patch) | |
tree | c693738b94f276a4cebe26d8de21de4f5f3c9c9e /gdb | |
parent | eda680f805f57e7acae71350b98c9cfabbda9a58 (diff) | |
download | gdb-686f09d02169f2e74f4465ed61f5be6f6664749b.zip gdb-686f09d02169f2e74f4465ed61f5be6f6664749b.tar.gz gdb-686f09d02169f2e74f4465ed61f5be6f6664749b.tar.bz2 |
* lib/gdb.exp (standard_testfile): Unset output variables from
earlier invocations.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index f4ad297..5d840db 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2012-07-10 Tom Tromey <tromey@redhat.com> + + * lib/gdb.exp (standard_testfile): Unset output variables from + earlier invocations. + 2012-07-10 Yao Qi <yao@codesourcery.com> * gdb.mi/gdb2549.exp: Remove -DFAKEARGV from compilation flags. diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 289d4d8..6ae3129 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -3098,6 +3098,7 @@ proc standard_output_file {basename} { proc standard_testfile {args} { global gdb_test_file_name global objdir subdir + global gdb_test_file_last_vars # Outputs. global testfile binfile @@ -3109,6 +3110,17 @@ proc standard_testfile {args} { set args .c } + # Unset our previous output variables. + # This can help catch hidden bugs. + if {[info exists gdb_test_file_last_vars]} { + foreach varname $gdb_test_file_last_vars { + global $varname + catch {unset $varname} + } + } + # 'executable' is often set by tests. + set gdb_test_file_last_vars {executable} + set suffix "" foreach arg $args { set varname srcfile$suffix @@ -3122,6 +3134,7 @@ proc standard_testfile {args} { } set $varname $arg + lappend gdb_test_file_last_vars $varname if {$suffix == ""} { set suffix 2 |