From patchwork Mon Feb 15 20:24:11 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Marchi X-Patchwork-Id: 10871 Received: (qmail 6539 invoked by alias); 15 Feb 2016 20:24:28 -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 6504 invoked by uid 89); 15 Feb 2016 20:24:26 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.9 required=5.0 tests=BAYES_00, KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=our X-HELO: usplmg20.ericsson.net Received: from usplmg20.ericsson.net (HELO usplmg20.ericsson.net) (198.24.6.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Mon, 15 Feb 2016 20:24:25 +0000 Received: from EUSAAHC005.ericsson.se (Unknown_Domain [147.117.188.87]) by usplmg20.ericsson.net (Symantec Mail Security) with SMTP id F1.E3.12433.83032C65; Mon, 15 Feb 2016 21:08:24 +0100 (CET) Received: from elxcz23q12-y4.dyn.mo.ca.am.ericsson.se (147.117.188.8) by smtps-am.internal.ericsson.com (147.117.188.87) with Microsoft SMTP Server (TLS) id 14.3.248.2; Mon, 15 Feb 2016 15:24:22 -0500 From: Simon Marchi To: CC: Simon Marchi Subject: [PATCH 2/2] testsuite: Make standard_temp_file use invocation-specific directories Date: Mon, 15 Feb 2016 15:24:11 -0500 Message-ID: <1455567851-2130-2-git-send-email-simon.marchi@ericsson.com> In-Reply-To: <1455567851-2130-1-git-send-email-simon.marchi@ericsson.com> References: <1455567851-2130-1-git-send-email-simon.marchi@ericsson.com> MIME-Version: 1.0 X-IsSubscribed: yes Just like standard_output_file, standard_temp_file should use multiple directories to make the tests parallel-safe. However, standard_temp_file is sometimes called in some procedures that are not test-specific. For example, gdb_init uses it, but is called once before all test files are ran. Therefore, we can't organize it in a temp/gdb.subdir/testname layout, like standard_output_file. Because it's just meant for temporary files that don't really need to be inspected after the test, we can just put them in a directory based on the runtest pid. There is always a single exp file being executed by a particular runtest invocation at any given time, so it should be safe. gdb/testsuite/ChangeLog: * lib/gdb.exp (standard_temp_file): Return a path specific to the runtest invocation. --- gdb/testsuite/lib/gdb.exp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 1fb05c4..a77bce4 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -4339,13 +4339,12 @@ proc standard_output_file {basename} { # Return the name of a file in our standard temporary directory. proc standard_temp_file {basename} { - global objdir GDB_PARALLEL - - if {[info exists GDB_PARALLEL]} { - return [make_gdb_parallel_path temp $basename] - } else { - return $basename - } + # Since a particular runtest invocation is only executing a single test + # file at any given time, we can use the runtest pid to build the + # path of the temp directory. + set dir [make_gdb_parallel_path temp [pid]] + file mkdir $dir + return [file join $dir $basename] } # Set 'testfile', 'srcfile', and 'binfile'.