From patchwork Wed Apr 2 04:51:36 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 384 Return-Path: X-Original-To: siddhesh@wilcox.dreamhost.com Delivered-To: siddhesh@wilcox.dreamhost.com Received: from homiemail-mx20.g.dreamhost.com (mx2.sub5.homie.mail.dreamhost.com [208.113.200.128]) by wilcox.dreamhost.com (Postfix) with ESMTP id 207FE3600BA for ; Tue, 1 Apr 2014 21:54:20 -0700 (PDT) Received: by homiemail-mx20.g.dreamhost.com (Postfix, from userid 14314964) id C6E1140C5093F; Tue, 1 Apr 2014 21:54:19 -0700 (PDT) X-Original-To: gdb@patchwork.siddhesh.in Delivered-To: x14314964@homiemail-mx20.g.dreamhost.com Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by homiemail-mx20.g.dreamhost.com (Postfix) with ESMTPS id A579A40C26A96 for ; Tue, 1 Apr 2014 21:54:19 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; q=dns; s=default; b=ecCGBcVQHSKXJgZbp0NaC2mVrNZD4 wbMmI1ZaKZwqtkqHiUsU3i//WqgmFlDfbXgE/ZXsIZMRsLf+H9jGfArdhWA8bBkK t1xgeXlVVCKHVylsefL+jwHVFv3MPg8BDIZHCoHhx7dUXHLeAlwXMqMsZdMipRyy qgYqDn+UojKBJ0= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type; s=default; bh=1dPd5hytuDAe+IuCeyiQCy3DyTs=; b=q5b wd1g/gFMOtcZ9/txhQE1gNdNViDmTtpqiLNMtEPpwBzoM7kJciE/jCoOwIXMFYC0 X+vqF2a+94F1wTyhFPeWueM8MBpVWqDXpbzVsPDiy4RuGk4Eo9uVk1LRkO/HKXIl 8JgYeefHcB32diFUPPeZg1WkNDCmtSVwl8355VG0= Received: (qmail 32365 invoked by alias); 2 Apr 2014 04:54:17 -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 32355 invoked by uid 89); 2 Apr 2014 04:54:16 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 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; Wed, 02 Apr 2014 04:54:16 +0000 Received: from svr-orw-exc-10.mgc.mentorg.com ([147.34.98.58]) by relay1.mentorg.com with esmtp id 1WVDBk-0007TH-Fy from Yao_Qi@mentor.com for gdb-patches@sourceware.org; Tue, 01 Apr 2014 21:54:12 -0700 Received: from SVR-ORW-FEM-05.mgc.mentorg.com ([147.34.97.43]) by SVR-ORW-EXC-10.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 1 Apr 2014 21:54:12 -0700 Received: from qiyao.dyndns.org.com (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.2.247.3; Tue, 1 Apr 2014 21:52:10 -0700 From: Yao Qi To: Subject: [PATCH] Check file exists before completion tests Date: Wed, 2 Apr 2014 12:51:36 +0800 Message-ID: <1396414296-26669-1-git-send-email-yao@codesourcery.com> MIME-Version: 1.0 X-IsSubscribed: yes X-DH-Original-To: gdb@patchwork.siddhesh.in Doug told me that there are some regressions in gdb.base/completion.exp. They are caused by my recent change, and can be reproduced via: $ make check-parallel TESTS=gdb.base/completion.exp FAIL: gdb.base/completion.exp: complete target core ./gdb.base/completion FAIL: gdb.base/completion.exp: complete target tfile ./gdb.base/completion FAIL: gdb.base/completion.exp: complete target exec ./gdb.base/completion Current tests assume that gdb.base/completion exists but that is wrong in a parallel run, because binary file and object files are placed in outputs/gdb.base/completion/. This patch is to check file exists on two candidate directories, "gdb.base" and "outputs/gdb.base/completion/", and run tests with files existed in either of them. OK? gdb/testsuite: 2014-04-02 Yao Qi * gdb.base/completion.exp: Check file exists before running tests on file completion. --- gdb/testsuite/gdb.base/completion.exp | 15 ++++++++++++--- 1 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/testsuite/gdb.base/completion.exp b/gdb/testsuite/gdb.base/completion.exp index 73e3a06..ff2dfd4 100644 --- a/gdb/testsuite/gdb.base/completion.exp +++ b/gdb/testsuite/gdb.base/completion.exp @@ -105,9 +105,18 @@ gdb_test_multiple "target ctf" "" { } } -foreach target_name ${targets} { - gdb_test "complete target ${target_name} ./gdb.base/completion" \ - "target ${target_name} \\./gdb.base/completion.*\\./gdb.base/completion0\\.o.*\\./gdb.base/completion1\\.o.*" +# Test artifacts are put in different locations depending on test +# is a parallel run or not. Firstly check file exists, and then +# do the test on file completion. + +foreach dir1 [ list "./gdb.base" "./outputs/gdb.base/completion" ] { + if [remote_file host exists ${dir1}/completion] { + foreach target_name ${targets} { + gdb_test "complete target ${target_name} ${dir1}/completion" \ + "target ${target_name} ${dir1}/completion.*${dir1}/completion0\\.o.*${dir1}/completion1\\.o.*" + } + break + } } #