]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
[gdb/testsuite] Fix gdb.base/local-env.exp on remote host
authorTom de Vries <tdevries@suse.de>
Sat, 3 Jan 2026 15:10:41 +0000 (16:10 +0100)
committerTom de Vries <tdevries@suse.de>
Sat, 3 Jan 2026 15:10:41 +0000 (16:10 +0100)
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
gdb/testsuite/gdb.base/local-env.exp

index 73b8e7d3c57faf7082ce3f7240f9182be0c7dc9d..1bc699293eea327ca0451b7f593507d62272b157 100644 (file)
@@ -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"
index 77151f0b7d10e3fe52004b740a6746a13db53657..4ccefa7f05d8b69797827a1e324174fadee154cd 100644 (file)
@@ -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" \