diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-10-29 14:59:23 +0000 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-11-04 15:51:40 +0000 |
commit | 91f8973ba3dff221eb4a3cd2695f3348260972f5 (patch) | |
tree | 042ad46506beba8d8c56b559729a6e05a9f0aa8d /gdb/testsuite | |
parent | 9247f052848f3961402754ebfbc1bc28cf0857a5 (diff) | |
download | gdb-91f8973ba3dff221eb4a3cd2695f3348260972f5.zip gdb-91f8973ba3dff221eb4a3cd2695f3348260972f5.tar.gz gdb-91f8973ba3dff221eb4a3cd2695f3348260972f5.tar.bz2 |
gdb/testsuite: spring clean the gdb.stabs/gdb11479.exp test
I had reason to look at the gdb.stabs/gdb11479.exp test script and
figured it could do with a small clean up. I've:
- Made use of standard_testfile and the variables it defines.
- Made use of with_test_prefix and removed the prefix from the end
of each test name.
- Avoid overwriting the test binary when we recompile, instead use a
different name for each recompilation.
- Add '.' at the end of each comment.
There should be no changes in what is tested with this commit.
Reviewed-By: Keith Seitz <keiths@redhat.com>
Diffstat (limited to 'gdb/testsuite')
-rw-r--r-- | gdb/testsuite/gdb.stabs/gdb11479.exp | 54 |
1 files changed, 30 insertions, 24 deletions
diff --git a/gdb/testsuite/gdb.stabs/gdb11479.exp b/gdb/testsuite/gdb.stabs/gdb11479.exp index 11d4be0..12f60ee 100644 --- a/gdb/testsuite/gdb.stabs/gdb11479.exp +++ b/gdb/testsuite/gdb.stabs/gdb11479.exp @@ -17,37 +17,43 @@ # Test GDB stabs problem with qualified parameter of forward types. - -set testfile "gdb11479" +standard_testfile proc do_test {version} { - if ![runto_main] { - return -1 + with_test_prefix "$version" { + if { ![runto_main] } { + return -1 + } + gdb_test "rb test" "" "set breakpoints" + gdb_test "continue" "Breakpoint .* test2 .*" \ + "stop at first breakpoint in test2 function" + + # Check that the struct is read in correctly. + gdb_test "print *t" ".*\{x = 5, y = 25, b = 2.5\}.*" \ + "Inspect t in test2" + + # Check that the enum type length has been set to a non-zero value. + gdb_test "print sizeof (*e)" "= \[1-9\]*" "sizeof (*e) in test2" + + gdb_test "continue" "Breakpoint .* test .*" \ + "Stop at first breakpoint test function" + + gdb_test "print *t" ".*\{x = 5, y = 25, b = 2.5\}.*" \ + "Inspect t in test" + + # Check that the enum type length has been set to a non-zero value. + gdb_test "print sizeof (*e)" "= \[1-9\]*" "sizeof (*e) in test" } - gdb_test "rb test" "" "set breakpoints $version" - gdb_test "continue" "Breakpoint .* test2 .*" "stop at first breakpoint $version" - # Check that the struct is read in correctly - gdb_test "print *t" ".*\{x = 5, y = 25, b = 2.5\}.*" \ - "Inspect t in test2 $version" - # Check that the enum type length has been set to a non-zero value - gdb_test "print sizeof (*e)" "= \[1-9\]*" "sizeof (*e) in test2 $version" - gdb_test "continue" "Breakpoint .* test .*" \ - "Stop at first breakpoint $version" - gdb_test "print *t" ".*\{x = 5, y = 25, b = 2.5\}.*" \ - "Inspect t in test $version" - # Check that the enum type length has been set to a non-zero value - gdb_test "print sizeof (*e)" "= \[1-9\]*" "sizeof (*e) in test $version" } -if { [prepare_for_testing "failed to prepare" $testfile $testfile.c {debug additional_flags=-gstabs quiet}] == 0 } { +# Compile and test with stabs debug format. +if { [prepare_for_testing "failed to prepare" ${testfile}-stabs $srcfile \ + {debug additional_flags=-gstabs quiet}] == 0 } { do_test forced_stabs } -# Without this gdb_exit the executable is still opened -# by GDB which can generate a compilation failure. -gdb_exit - -if { [prepare_for_testing "failed to prepare" $testfile $testfile.c {debug}] == 0 } { +# Compile and test with the default debug format. +if { [prepare_for_testing "failed to prepare" ${testfile}-default \ + $srcfile] == 0 } { do_test natural_debug_format } - |