This is the mail archive of the gdb-patches@sourceware.org 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]

[PATCH] Clear GREP_OPTIONS environment variable.


The test gdb.base/maint.exp shells out from gdb to use grep. I have GREP_OPTIONS="--color=auto" in my environment and this causes the test to fail. The patch below clears this environment variable before running gdb. Ok to apply?

Cheers,
Andrew


gdb/testsuite/ChangeLog

2011-03-15  Andrew Burgess  <aburgess@broadcom.com>

	* lib/gdb.exp (default_gdb_start): Clear the GREP_OPTIONS
	environment variable to make grep output more predictable.

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 1b601af..547a232 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -1331,6 +1331,11 @@ proc default_gdb_start { } {
     # The same bug doesn't show up if we use ^P / ^N instead.
     set env(TERM) "vt100"
 
+    # Some tests (for example gdb.base/maint.exp) shell out from gdb to use
+    # grep.  Clear GREP_OPTIONS to make the behavoiur predictable, 
+    # especially having color output turned on can cause tests to fail.
+    set env(GREP_OPTIONS) ""
+
     verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
 
     if [info exists gdb_spawn_id] {


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