aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2014-11-02 21:08:06 +0800
committerYao Qi <yao@codesourcery.com>2014-11-02 21:08:06 +0800
commit6ce8c98020188a7585c24db289191c5c10371e58 (patch)
treef5ea651a5927b1936ec6c6405bff68ca7a06d801 /gdb
parenta218b38d2e3f2f7c55b59b380267fdf7fffdb966 (diff)
downloadgdb-6ce8c98020188a7585c24db289191c5c10371e58.zip
gdb-6ce8c98020188a7585c24db289191c5c10371e58.tar.gz
gdb-6ce8c98020188a7585c24db289191c5c10371e58.tar.bz2
Match the working directory on remote host
The test in gdb.python/python.exp tests "extended-prompt" and expects working directory is printed. However, working directory on remote host doesn't have "gdb/testsuite", so the test fails on remote host like: set extended-prompt \w ^M ^M /home/yao FAIL: gdb.python/python.exp: set extended prompt working directory (timeout) This patch is to get the working directory first, and use it to match the output of "set extended-prompt \\w ". It works for remote host and non remote host. gdb/testsuite: 2014-11-02 Yao Qi <yao@codesourcery.com> * gdb.python/python.exp: Get working directory and match the output of "set extended-prompt \\w " with it.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/testsuite/ChangeLog5
-rw-r--r--gdb/testsuite/gdb.python/python.exp9
2 files changed, 13 insertions, 1 deletions
diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 4f2f208..2aff9de 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2014-11-02 Yao Qi <yao@codesourcery.com>
+
+ * gdb.python/python.exp: Get working directory and match the
+ output of "set extended-prompt \\w " with it.
+
2014-10-30 Doug Evans <dje@google.com>
* gdb.python/py-objfile.exp: Add tests for setting random attributes
diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp
index 0e77256..787a294 100644
--- a/gdb/testsuite/gdb.python/python.exp
+++ b/gdb/testsuite/gdb.python/python.exp
@@ -314,6 +314,13 @@ gdb_test_multiple "set prompt $gdb_prompt " "set default prompt" {
}
}
+set working_dir ""
+gdb_test_multiple "pwd" "pwd" {
+ -re "Working directory (.*)\\.\[\r\n\]+$gdb_prompt $" {
+ set working_dir $expect_out(1,string)
+ }
+}
+
gdb_test_multiple "python gdb.prompt_hook = program_prompt" "set the hook" {
-re "\[\r\n\]$gdb_prompt $" {
pass "set programming hook"
@@ -346,7 +353,7 @@ gdb_test_multiple "set extended-prompt one two three " \
gdb_test_multiple "set extended-prompt \\w " \
"set extended prompt working directory" {
- -re "\[\r\n\].*gdb.*testsuite.* $" {
+ -re "\[\r\n\][string_to_regexp $working_dir] $" {
pass "set extended prompt working directory"
}
}