This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[commit] Fix testenv.exp test case


I've noticed two issues with the new testenv.exp test case:

- passing environment variables across the remote protocol is not
  supported, so this test shouldn't be run remotely

- when running multiple passes of the testsuite in a row
  (e.g. using unix/{-m32,-m64}), the second pass will fail because
  a global environment variable has remained set after the end of
  the first pass

Fixed by the patch below.  Tested on s390x-ibm-linux.
Committed to mainline.



	* gdb.base/testenv.exp: Skip on remote targets.  Unset global
	environment variable after test completed.

Index: gdb-head/gdb/testsuite/gdb.base/testenv.exp
--- gdb-head.orig/gdb/testsuite/gdb.base/testenv.exp
+++ gdb-head/gdb/testsuite/gdb.base/testenv.exp
@@ -22,6 +22,10 @@ if $tracelevel then {
 	strace $tracelevel
+# There's no support for passing environment variables in the remote protocol.
+if { [is_remote target] } {
+    return 0
 set testfile "testenv"
 set srcfile ${testfile}.c
@@ -119,3 +123,7 @@ gdb_test "continue" \
   "Test with TEST_GDB_GLOBAL unset"
+# Clear environment in case we're doing multiple runs
+unset env(TEST_GDB_GLOBAL)
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]