* gdb.base/completion.exp (INPUTRC): Set this environment variable
[deliverable/binutils-gdb.git] / gdb / testsuite / gdb.base / completion.exp
index 2db201236ed0907c4432f4401eb14a4df5b911a9..8c8f676d8dae7b4e56aaedcb4da6ee71134ac936 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 1998 Free Software Foundation, Inc.
+# Copyright 1998, 1999 Free Software Foundation, Inc.
 
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -52,11 +52,6 @@ if $tracelevel then {
         }
 
 
-if { ![istarget "hppa*-hp-hpux*"] } {
-    #skip all these tests for now (FIXME)
-    continue
-}
-
 global usestubs
 
 #
@@ -77,6 +72,19 @@ if [get_compiler_info ${binfile}] {
 }
 
 gdb_exit
+
+# Don't let a .inputrc file or an existing setting of INPUTRC mess up
+# the test results.  Even if /dev/null doesn't exist on the particular
+# platform, the readline library will use the default setting just by
+# failing to open the file.  OTOH, opening /dev/null successfully will
+# also result in the default settings being used since nothing will be
+# read from this file.
+global env
+if [info exists env(INPUTRC)] {
+    set old_inputrc $env(INPUTRC)
+}
+set env(INPUTRC) "/dev/null"
+
 gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
@@ -379,7 +387,7 @@ gdb_expect {
     -re "^p 'a\\\x07$" {
        send_gdb "\t"
        gdb_expect {
-           -re "a64l.*atol.*$gdb_prompt p .a$" {
+           -re "a64l.*argv.*$gdb_prompt p .a$" {
                send_gdb "\n"
                gdb_expect {
                    -re "Invalid character constant\\..*$gdb_prompt $" {
@@ -439,7 +447,7 @@ gdb_expect {
     -re "^p b-a\\\x07$" {
        send_gdb "\t"
        gdb_expect {
-           -re "a64l.*atol.*$gdb_prompt p b-a$" {
+           -re "a64l.*argv.*$gdb_prompt p b-a$" {
                send_gdb "\n"
                gdb_expect {
                    -re "No symbol \"b\" in current context\\..*$gdb_prompt $" {
@@ -533,10 +541,10 @@ gdb_expect  {
         }
 
 
-send_gdb "file ${srcdir}/gdb.base/self\t"
+send_gdb "file ${srcdir}/gdb.base/compl\t"
 sleep 1
 gdb_expect  {
-        -re "^file ${srcdir}/gdb.base/.*'selftest\\.exp' $"\
+        -re "^file ${srcdir}/gdb.base/completion\\.exp $"\
             { send_gdb "\n"
               gdb_expect {
                       -re "\r\nA program is being debugged already\\.  Kill it\\? \\(y or n\\) $"
@@ -544,20 +552,19 @@ gdb_expect  {
                       { send_gdb "n\n"
                         gdb_expect {
                                 -re "\r\nProgram not killed\\.\r\n$gdb_prompt $"\
-                                        { pass "complete 'file gdb.base/self'"}
-                                -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'"}
-                                timeout           {fail "(timeout) complete 'file gdb.base/self'"}
+                                        { pass "complete 'file gdb.base/compl'"}
+                                -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/compl'"}
+                                timeout           {fail "(timeout) complete 'file gdb.base/compl'"}
                                }
                       }
-                      -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/self'"}
-                      timeout           {fail "(timeout) complete 'file gdb.base/self'"}
+                      -re ".*$gdb_prompt $" { fail "complete 'file gdb.base/compl'"}
+                      timeout           {fail "(timeout) complete 'file gdb.base/compl'"}
                      }
             }
-        -re ".*$gdb_prompt $"       { fail "complete 'file gdb.base/self'" }
-        timeout         { fail "(timeout) complete 'file gdb.base/self'" }
+        -re ".*$gdb_prompt $"       { fail "complete 'file gdb.base/compl'" }
+        timeout         { fail "(timeout) complete 'file gdb.base/compl'" }
         }
 
-
 send_gdb "info func mark\t"
 sleep 1
 gdb_expect  {
@@ -569,7 +576,7 @@ gdb_expect  {
                       -re "marker1.*$gdb_prompt info func marker$"\
                       { send_gdb "\n"
                         gdb_expect {
-                                -re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(.*\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long\\);\r\n$gdb_prompt $"\
+                                -re "All functions matching regular expression \"marker\":\r\n\r\nFile.*break.c:\r\nint marker1\\(\\);\r\nint marker2\\(int\\).*marker3\\(char.*char.*\\).*marker4\\(long int\\);\r\n$gdb_prompt $"\
                                                   { pass "complete 'info func mar'"}
                                 -re ".*$gdb_prompt $" { fail "complete 'info func mar'"}
                                 timeout           {fail "(timeout) complete 'info func mar'"}
@@ -590,7 +597,7 @@ gdb_expect  {
         -re "ask.*child.*parent.*$gdb_prompt set follow-fork-mode $"\
             { send_gdb "\n"
               gdb_expect {
-                      -re "Requires an argument.*parent.*child.*ask.*$gdb_prompt $"\
+                      -re "Requires an argument.*ask.*child.*parent.*$gdb_prompt $"\
                                         { pass "complete 'set follow-fork-mode'"}
                       -re "Ambiguous item \"\"\\..*$gdb_prompt $"\
                                         { pass "complete 'set follow-fork-mode'"}
@@ -602,19 +609,12 @@ gdb_expect  {
         timeout         { fail "(timeout) complete 'set follow-fork-mode'" }
         }
 
+# Restore globals modified in this test...
+if [info exists old_inputrc] {
+    set env(INPUTRC) $old_inputrc
+} else {
+    unset env(INPUTRC)
+}
 set timeout $oldtimeout1
-return 0
-
-
-
-
-
-
-
-
-
-
-
-
-
 
+return 0
This page took 0.026426 seconds and 4 git commands to generate.