public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [pushed] [gdb/testsuite] Two fixes in gdb.python/tui-window-disabled.exp
Date: Fri, 24 Nov 2023 15:38:31 +0100	[thread overview]
Message-ID: <20231124143831.1167-1-tdevries@suse.de> (raw)

I ran test-case gdb.python/tui-window-disabled.exp on a configuration without
python support, and ran into:
...
PASS: $exp: cleanup_properly=True: initial restart: set pagination off
UNSUPPORTED: $exp: cleanup_properly=True: couldn't restart GDB
PASS: $exp: cleanup_properly=False: initial restart: set pagination off
UNSUPPORTED: $exp: cleanup_properly=False: couldn't restart GDB
...

After looking into the test-case, I realized that this is a consequence of
!allow_python_tests.

Handle this instead by requiring allow_python_tests, such that we get the usual
and more clear:
...
UNSUPPORTED: $exp: require failed: allow_python_tests
...

Also fix a return without value in clean_restart_and_setup, which if triggered
would cause:
...
ERROR: expected boolean value but got ""
...

Tested on x86_64-linux.
---
 gdb/testsuite/gdb.python/tui-window-disabled.exp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/gdb/testsuite/gdb.python/tui-window-disabled.exp b/gdb/testsuite/gdb.python/tui-window-disabled.exp
index fc69b2b16c2..1d10437711d 100644
--- a/gdb/testsuite/gdb.python/tui-window-disabled.exp
+++ b/gdb/testsuite/gdb.python/tui-window-disabled.exp
@@ -22,7 +22,7 @@
 # though the tui should be disabled.
 
 load_lib gdb-python.exp
-require allow_tui_tests
+require allow_tui_tests allow_python_tests
 tuiterm_env
 
 standard_testfile
@@ -49,9 +49,6 @@ proc clean_restart_and_setup { prefix } {
 
 	Term::clean_restart 24 80 $testfile
 
-	# Skip all tests if Python scripting is not enabled.
-	if { ![allow_python_tests] } { return 0 }
-
 	# Now source the python script.
 	gdb_test_no_output "source ${remote_python_file}" \
 	    "source ${testfile}.py"
@@ -64,7 +61,7 @@ proc clean_restart_and_setup { prefix } {
 
 	if {![runto_main]} {
 	    perror "test suppressed"
-	    return
+	    return 0
 	}
     }
 

base-commit: fa1c74b22aa8c465974ddf792395d8e313199a52
-- 
2.35.3


                 reply	other threads:[~2023-11-24 14:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231124143831.1167-1-tdevries@suse.de \
    --to=tdevries@suse.de \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).