Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom de Vries <tdevries@suse.de>
To: gdb-patches@sourceware.org
Subject: [PATCH] [gdb/testsuite] Fix gdb.base/local-env.exp on remote host
Date: Thu, 11 Dec 2025 16:42:11 +0100	[thread overview]
Message-ID: <20251211154211.1086859-1-tdevries@suse.de> (raw)

With host/target board local-remote-host-native.exp and other remote host
configurations, and test-case gdb.base/local-env.exp I get:
...
(gdb) show environment^M
  ...
(gdb) FAIL: $exp: show environment displayed variable
...

The test attempt to detect variable GDB_TEST_ENV_VAR in the environment, which
has been set with setenv.

This doesn't work with remote host, so declare the test unsupported.  Likewise
in gdb.base/environ.exp.

Tested on x86_64-linux with make-check-all.sh.
---
 gdb/testsuite/gdb.base/environ.exp   | 7 ++++++-
 gdb/testsuite/gdb.base/local-env.exp | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/environ.exp b/gdb/testsuite/gdb.base/environ.exp
index 091010acfda..d95a6f7d03c 100644
--- a/gdb/testsuite/gdb.base/environ.exp
+++ b/gdb/testsuite/gdb.base/environ.exp
@@ -46,7 +46,12 @@ gdb_test_multiple "show environment" "show environment works" -lbl {
     }
 }
 
-gdb_assert {$saw_env == 1} "show environment displayed variable"
+set test "show environment displayed variable"
+if {[is_remote host]} {
+    unsupported $test
+} else {
+    gdb_assert {$saw_env == 1} $test
+}
 
 # Verify that we can unset a specific environment variable.
 gdb_test_no_output "unset environment EDITOR" "unset environment variable"
diff --git a/gdb/testsuite/gdb.base/local-env.exp b/gdb/testsuite/gdb.base/local-env.exp
index c62ea746635..394504cd79b 100644
--- a/gdb/testsuite/gdb.base/local-env.exp
+++ b/gdb/testsuite/gdb.base/local-env.exp
@@ -48,7 +48,12 @@ gdb_test_multiple "show environment" "show environment works" -lbl {
     }
 }
 
-gdb_assert {$saw_env == 1} "show environment displayed variable"
+set test "show environment displayed variable"
+if {[is_remote host]} {
+    unsupported $test
+} else {
+    gdb_assert {$saw_env == 1} $test
+}
 
 # Verify that we can unset a specific environment variable.
 gdb_test_no_output "unset local-environment EDITOR" \

base-commit: 4f9b9eaa24383d920f37fbeb0592113252e37bbc
-- 
2.51.0


             reply	other threads:[~2025-12-11 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-11 15:42 Tom de Vries [this message]
2025-12-18 18:58 ` Tom Tromey
2025-12-19  9:40   ` Tom de Vries
2026-01-03 15:11 ` Tom de Vries

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=20251211154211.1086859-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