From patchwork Thu Oct 16 13:39:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 3247 Received: (qmail 15871 invoked by alias); 16 Oct 2014 13:44:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 15862 invoked by uid 89); 16 Oct 2014 13:44:25 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL, BAYES_00 autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 16 Oct 2014 13:44:25 +0000 Received: from svr-orw-fem-03.mgc.mentorg.com ([147.34.97.39]) by relay1.mentorg.com with esmtp id 1XelLq-0004jj-2A from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Thu, 16 Oct 2014 06:44:22 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-03.mgc.mentorg.com (147.34.97.39) with Microsoft SMTP Server id 14.3.181.6; Thu, 16 Oct 2014 06:44:21 -0700 From: Yao Qi To: Subject: [PATCH] Match the working directory on remote host Date: Thu, 16 Oct 2014 21:39:20 +0800 Message-ID: <1413466760-25886-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes 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-10-16 Yao Qi * gdb.python/python.exp: Get working directory and match the output of "set extended-prompt \\w " with it. --- gdb/testsuite/gdb.python/python.exp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gdb/testsuite/gdb.python/python.exp b/gdb/testsuite/gdb.python/python.exp index 3df9347..30785b9 100644 --- a/gdb/testsuite/gdb.python/python.exp +++ b/gdb/testsuite/gdb.python/python.exp @@ -298,6 +298,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" @@ -330,7 +337,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\]${working_dir} $" { pass "set extended prompt working directory" } }