From patchwork Tue Jun 11 11:51:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Maciej W. Rozycki" X-Patchwork-Id: 91879 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7036C385DDC8 for ; Tue, 11 Jun 2024 11:52:19 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from angie.orcam.me.uk (angie.orcam.me.uk [IPv6:2001:4190:8020::34]) by sourceware.org (Postfix) with ESMTP id 51259385DDE1 for ; Tue, 11 Jun 2024 11:51:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 51259385DDE1 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orcam.me.uk Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orcam.me.uk ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 51259385DDE1 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:4190:8020::34 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718106700; cv=none; b=ZkFD7sOIpHhg9hSAqyoenvfYWS019exlkZna8fdxqrlGHl6aYlwtbm8nPCFpOT64MEMpaVOSMnuZa8Z+cFsONmeGZ6bSXvR7P6EisK6+wDnnXXGlW3XeQES3JO9t2dG0ILJ8ps92Ssrc24Nv8nn8BmGrYMIHjD4gHGJKTZkbPdQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1718106700; c=relaxed/simple; bh=4yWBQG6o+GnkwySTqkeBZltAgKIbSCNouNmgDB1AoVA=; h=Date:From:To:Subject:Message-ID:MIME-Version; b=PPACa0ztPA8qErAPrY/xcgNp6o8dkuwXsqK0zGc3abdcAWbr+M2Eq54ZhYY+g1rs8fUeSEwF6Yqe/6Y0xznQucPMcJiG5IzGnKSodpqQyBt7GhTkG/+2ViydEvxWRr80p+e8EQYLnZx2b4Xatsh2VX3dQ/y6DDDfaLBHBjhwvJQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by angie.orcam.me.uk (Postfix, from userid 500) id D48E692009D; Tue, 11 Jun 2024 13:51:38 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by angie.orcam.me.uk (Postfix) with ESMTP id D2D2D92009B for ; Tue, 11 Jun 2024 12:51:38 +0100 (BST) Date: Tue, 11 Jun 2024 12:51:38 +0100 (BST) From: "Maciej W. Rozycki" To: binutils@sourceware.org Subject: [PATCH 2/3] GAS/testsuite: Add a helper for paths outside the source dir In-Reply-To: Message-ID: References: User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 X-Spam-Status: No, score=-3488.4 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, KAM_INFOUSMEBIZ, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: binutils@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+patchwork=sourceware.org@sourceware.org From: Maciej W. Rozycki Implement a helper to construct a relative path from $srcdir/$subdir, where `gas_run' operates, to an arbitrary place in the filesystem, for example a file in the test object directory. --- gas/testsuite/lib/gas-defs.exp | 13 +++++++++++++ 1 file changed, 13 insertions(+) binutils-test-gas-srcdir-path.diff Index: binutils-gdb/gas/testsuite/lib/gas-defs.exp =================================================================== --- binutils-gdb.orig/gas/testsuite/lib/gas-defs.exp +++ binutils-gdb/gas/testsuite/lib/gas-defs.exp @@ -104,6 +104,19 @@ proc gas_host_run { cmd redir } { return [list [lindex $status 0] "$to_return"] } +# gas_srcdir_path FILENAME +# +# Return a path to FILENAME relative to the directory we normally get +# sources from in the current script. For use when the actual source +# is for example in the test output directory. + +proc gas_srcdir_path { filename } { + global srcdir + global subdir + + return [get_relative_path $srcdir/$subdir $filename] +} + proc gas_run { prog as_opts redir } { global AS global ASFLAGS