diff options
Diffstat (limited to 'gdb')
28 files changed, 56 insertions, 97 deletions
diff --git a/gdb/testsuite/gdb.guile/scm-arch.exp b/gdb/testsuite/gdb.guile/scm-arch.exp index 7ec1db1..c2554d8 100644 --- a/gdb/testsuite/gdb.guile/scm-arch.exp +++ b/gdb/testsuite/gdb.guile/scm-arch.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-block.exp b/gdb/testsuite/gdb.guile/scm-block.exp index 666d6fd..20fbd17 100644 --- a/gdb/testsuite/gdb.guile/scm-block.exp +++ b/gdb/testsuite/gdb.guile/scm-block.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-breakpoint.exp b/gdb/testsuite/gdb.guile/scm-breakpoint.exp index cd469ca..a9e656d 100644 --- a/gdb/testsuite/gdb.guile/scm-breakpoint.exp +++ b/gdb/testsuite/gdb.guile/scm-breakpoint.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - proc_with_prefix test_bkpt_basic { } { global srcfile testfile hex decimal diff --git a/gdb/testsuite/gdb.guile/scm-cmd.exp b/gdb/testsuite/gdb.guile/scm-cmd.exp index 1d4e13d..a7fb59b 100644 --- a/gdb/testsuite/gdb.guile/scm-cmd.exp +++ b/gdb/testsuite/gdb.guile/scm-cmd.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-disasm.exp b/gdb/testsuite/gdb.guile/scm-disasm.exp index 6609c74..37b710f 100644 --- a/gdb/testsuite/gdb.guile/scm-disasm.exp +++ b/gdb/testsuite/gdb.guile/scm-disasm.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-equal.exp b/gdb/testsuite/gdb.guile/scm-equal.exp index d2fb9ef..3f6e0c5 100644 --- a/gdb/testsuite/gdb.guile/scm-equal.exp +++ b/gdb/testsuite/gdb.guile/scm-equal.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-error.exp b/gdb/testsuite/gdb.guile/scm-error.exp index b0de521..168d71d 100644 --- a/gdb/testsuite/gdb.guile/scm-error.exp +++ b/gdb/testsuite/gdb.guile/scm-error.exp @@ -19,13 +19,12 @@ set testfile "scm-error" load_lib gdb-guile.exp +require allow_guile_tests + # Start with a fresh gdb. gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # Test error while loading .scm. set remote_guile_file_1 [gdb_remote_download host \ diff --git a/gdb/testsuite/gdb.guile/scm-frame-args.exp b/gdb/testsuite/gdb.guile/scm-frame-args.exp index 075f441..67c10f6 100644 --- a/gdb/testsuite/gdb.guile/scm-frame-args.exp +++ b/gdb/testsuite/gdb.guile/scm-frame-args.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame-inline.exp b/gdb/testsuite/gdb.guile/scm-frame-inline.exp index 88a69fd..1f73ed6 100644 --- a/gdb/testsuite/gdb.guile/scm-frame-inline.exp +++ b/gdb/testsuite/gdb.guile/scm-frame-inline.exp @@ -15,15 +15,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-frame.exp b/gdb/testsuite/gdb.guile/scm-frame.exp index 3118d6b..2e85496 100644 --- a/gdb/testsuite/gdb.guile/scm-frame.exp +++ b/gdb/testsuite/gdb.guile/scm-frame.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # The following tests require execution. if ![gdb_guile_runto_main] { diff --git a/gdb/testsuite/gdb.guile/scm-gsmob.exp b/gdb/testsuite/gdb.guile/scm-gsmob.exp index ded2a85..a7c95c0 100644 --- a/gdb/testsuite/gdb.guile/scm-gsmob.exp +++ b/gdb/testsuite/gdb.guile/scm-gsmob.exp @@ -18,13 +18,12 @@ load_lib gdb-guile.exp +require allow_guile_tests + # Start with a fresh gdb. gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_reinitialize_dir $srcdir/$subdir gdb_install_guile_utils diff --git a/gdb/testsuite/gdb.guile/scm-iterator.exp b/gdb/testsuite/gdb.guile/scm-iterator.exp index 1597452..0bf4595 100644 --- a/gdb/testsuite/gdb.guile/scm-iterator.exp +++ b/gdb/testsuite/gdb.guile/scm-iterator.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-lazy-string.exp b/gdb/testsuite/gdb.guile/scm-lazy-string.exp index 9b2960a..6052356 100644 --- a/gdb/testsuite/gdb.guile/scm-lazy-string.exp +++ b/gdb/testsuite/gdb.guile/scm-lazy-string.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - #gdb_install_guile_utils #gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/scm-math.exp b/gdb/testsuite/gdb.guile/scm-math.exp index 97a2e58..42e195a 100644 --- a/gdb/testsuite/gdb.guile/scm-math.exp +++ b/gdb/testsuite/gdb.guile/scm-math.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile proc test_value_numeric_ops {} { @@ -335,9 +337,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c}]} { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-objfile-script.exp b/gdb/testsuite/gdb.guile/scm-objfile-script.exp index bd0fd00..5b480d1 100644 --- a/gdb/testsuite/gdb.guile/scm-objfile-script.exp +++ b/gdb/testsuite/gdb.guile/scm-objfile-script.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { @@ -28,9 +30,6 @@ if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # Make the -gdb.scm script available to gdb, it is automagically loaded by gdb. # Care is taken to put it in the same directory as the binary so that # gdb will find it. diff --git a/gdb/testsuite/gdb.guile/scm-objfile.exp b/gdb/testsuite/gdb.guile/scm-objfile.exp index eb49600..f27c9f4 100644 --- a/gdb/testsuite/gdb.guile/scm-objfile.exp +++ b/gdb/testsuite/gdb.guile/scm-objfile.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-parameter.exp b/gdb/testsuite/gdb.guile/scm-parameter.exp index db76fc2..d62ae47 100644 --- a/gdb/testsuite/gdb.guile/scm-parameter.exp +++ b/gdb/testsuite/gdb.guile/scm-parameter.exp @@ -18,14 +18,13 @@ load_lib gdb-guile.exp +require allow_guile_tests + # Start with a fresh gdb. gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_install_guile_utils gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/scm-ports.exp b/gdb/testsuite/gdb.guile/scm-ports.exp index 318c434..f0af5d4 100644 --- a/gdb/testsuite/gdb.guile/scm-ports.exp +++ b/gdb/testsuite/gdb.guile/scm-ports.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-pretty-print.exp b/gdb/testsuite/gdb.guile/scm-pretty-print.exp index f21ed41..3c20edf 100644 --- a/gdb/testsuite/gdb.guile/scm-pretty-print.exp +++ b/gdb/testsuite/gdb.guile/scm-pretty-print.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile # Start with a fresh gdb. gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - proc run_lang_tests {exefile lang} { with_test_prefix "lang=$lang" { global srcdir subdir srcfile testfile hex diff --git a/gdb/testsuite/gdb.guile/scm-progspace.exp b/gdb/testsuite/gdb.guile/scm-progspace.exp index f43e65e..c12a81e 100644 --- a/gdb/testsuite/gdb.guile/scm-progspace.exp +++ b/gdb/testsuite/gdb.guile/scm-progspace.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if {[build_executable $testfile.exp $testfile $srcfile debug] == -1} { @@ -30,9 +32,6 @@ gdb_exit gdb_start gdb_reinitialize_dir $srcdir/$subdir -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_install_guile_utils gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/scm-section-script.exp b/gdb/testsuite/gdb.guile/scm-section-script.exp index 34ee6de..9e52939 100644 --- a/gdb/testsuite/gdb.guile/scm-section-script.exp +++ b/gdb/testsuite/gdb.guile/scm-section-script.exp @@ -30,6 +30,8 @@ if {![istarget *-*-linux*] load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile # Make this available to gdb before the program starts, it is @@ -48,9 +50,6 @@ if {[build_executable $testfile.exp $testfile $srcfile \ gdb_exit gdb_start -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_reinitialize_dir $srcdir/$subdir # Try first with a restrictive safe-path. diff --git a/gdb/testsuite/gdb.guile/scm-symbol.exp b/gdb/testsuite/gdb.guile/scm-symbol.exp index f4b935f..fa2cf77 100644 --- a/gdb/testsuite/gdb.guile/scm-symbol.exp +++ b/gdb/testsuite/gdb.guile/scm-symbol.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - # These tests are done before we call gdb_guile_runto_main so we have to # import the gdb module ourselves. gdb_install_guile_utils diff --git a/gdb/testsuite/gdb.guile/scm-symtab.exp b/gdb/testsuite/gdb.guile/scm-symtab.exp index 33308e0..0f468b7 100644 --- a/gdb/testsuite/gdb.guile/scm-symtab.exp +++ b/gdb/testsuite/gdb.guile/scm-symtab.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile scm-symtab.c scm-symtab-2.c if {[prepare_for_testing "failed to prepare" $testfile \ @@ -25,9 +27,6 @@ if {[prepare_for_testing "failed to prepare" $testfile \ return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-type.exp b/gdb/testsuite/gdb.guile/scm-type.exp index f8902a3..45139cb 100644 --- a/gdb/testsuite/gdb.guile/scm-type.exp +++ b/gdb/testsuite/gdb.guile/scm-type.exp @@ -43,7 +43,7 @@ proc restart_gdb {exefile} { gdb_reinitialize_dir $srcdir/$subdir gdb_load ${exefile} - if { [skip_guile_tests] } { + if { ![allow_guile_tests] } { return 0 } diff --git a/gdb/testsuite/gdb.guile/scm-value-cc.exp b/gdb/testsuite/gdb.guile/scm-value-cc.exp index 5b2a3c9..921d7a9 100644 --- a/gdb/testsuite/gdb.guile/scm-value-cc.exp +++ b/gdb/testsuite/gdb.guile/scm-value-cc.exp @@ -18,7 +18,7 @@ load_lib gdb-guile.exp -require allow_cplus_tests +require allow_cplus_tests allow_guile_tests standard_testfile .cc @@ -26,9 +26,6 @@ if {[prepare_for_testing "failed to prepare" $testfile $srcfile {debug c++}]} { return } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/gdb.guile/scm-value.exp b/gdb/testsuite/gdb.guile/scm-value.exp index 9858b1c..a00c940 100644 --- a/gdb/testsuite/gdb.guile/scm-value.exp +++ b/gdb/testsuite/gdb.guile/scm-value.exp @@ -18,6 +18,8 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile set has_argv0 [gdb_has_argv0] @@ -427,9 +429,6 @@ if { [build_inferior "${binfile}" "c"] < 0 } { # Start with a fresh gdb. clean_restart ${binfile} -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - gdb_install_guile_utils gdb_install_guile_module diff --git a/gdb/testsuite/gdb.guile/types-module.exp b/gdb/testsuite/gdb.guile/types-module.exp index 520c902..2b90d1b 100644 --- a/gdb/testsuite/gdb.guile/types-module.exp +++ b/gdb/testsuite/gdb.guile/types-module.exp @@ -18,15 +18,14 @@ load_lib gdb-guile.exp +require allow_guile_tests + standard_testfile .cc if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } { return -1 } -# Skip all tests if Guile scripting is not enabled. -if { [skip_guile_tests] } { continue } - if ![gdb_guile_runto_main] { return } diff --git a/gdb/testsuite/lib/gdb-guile.exp b/gdb/testsuite/lib/gdb-guile.exp index 845d584..f230737 100644 --- a/gdb/testsuite/lib/gdb-guile.exp +++ b/gdb/testsuite/lib/gdb-guile.exp @@ -18,24 +18,11 @@ # Guile doesn't print the 0x prefix on hex numbers. set ghex {[0-9a-f]+} -# Return a 1 for configurations that do not support Guile scripting. +# Return a 1 for configurations that support Guile scripting. -proc skip_guile_tests {} { - global gdb_prompt - - gdb_test_multiple "guile (display \"test\\n\")" "verify guile support" { - -re "Undefined command.*$gdb_prompt $" { - unsupported "Guile not supported." - return 1 - } - -re "not supported.*$gdb_prompt $" { - unsupported "Guile support is disabled." - return 1 - } - -re "$gdb_prompt $" {} - } - - return 0 +gdb_caching_proc allow_guile_tests { + set output [exec $::GDB --configuration] + return [expr {[string first "--with-guile" $output] != -1}] } # Run a command in GDB, and report a failure if a Scheme exception is thrown. |