From patchwork Thu Feb 23 11:04:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Cl=C3=A9ment_Chigot?= X-Patchwork-Id: 60907 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp250700wrd; Thu, 23 Feb 2023 03:04:37 -0800 (PST) X-Google-Smtp-Source: AK7set8lU25i6zIR2fR7zQIBgfJIG4zBo6q5xTkHFePZ+X96HnPjTRdXloTz7iWFQuO5yZFjedYI X-Received: by 2002:a17:907:b9ca:b0:88d:f759:15b0 with SMTP id xa10-20020a170907b9ca00b0088df75915b0mr18577917ejc.45.1677150277058; Thu, 23 Feb 2023 03:04:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1677150277; cv=none; d=google.com; s=arc-20160816; b=hoLheQIzsdCUX8ICOa8J3yZKs87gw/PWuHOE+Ce69D3IyTfomHwOe/Q7LgYgON8sAZ U6WkXx9d6Yk6jrlfUBi7wc6lCwV4n6fqRvN+opk8u1JYfpJ39B4lTRoS16ShOIJQuZl4 fidBSCrBv5sEIHlyPeB4yo8IeNyxmOUD8WkxTtXgWxKE3TxQEgQahTdrCvSGbZdF9Upp o3U77YTNGCTiOYag8Q65Tvg+ubiPdsV4ktsxvgwK2hvGMofAXe16puuPlHhCXSp6xkjT ekrFwfkhB6ZKorA0XF1t4C6GRQsFRALJaU4QaNvHCO1wlhCpOX8i//YeLA18a6iYFPYw Usbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:reply-to:from:list-subscribe:list-help:list-post :list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:dmarc-filter:delivered-to:dkim-signature:dkim-filter; bh=m24yXh3lQ+xYjluJw/+M/f+ObIG+L9xqsPSKFfEMk9g=; b=P8r/CU+xQNTADAjjONwzONd/LBziY53xilet0rrh8HLo7rXcGLL4pMhAWgg5d489kV ZvIfFp8nU1OJWfHXuUbiSHWf6qcAjIzIildG8UZxYPzfgI3bZbaEpV//qM0bI6Mc4iDe /slGso34XG47OnTiRgoRLo+bVuWNUiXfXeDEAHxXKqQvtmuP+ZwKt0DLbWnrfc1pNqty 5uUDD35Yktl9oqFiPGkjXjIPbCX4RlmYy5xpr+7R7OQHPeet9+oLM8G8jTodJCCc1TJO V5fF2oQuWHkb96fXc5/oOwApAC069P43DzLP+8hkz3NIUOy9gtwa+TN1Yc4h6zwEnVbM 9ZEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qkG1RQ9E; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id 30-20020a17090600de00b008c0f93e4de3si21367406eji.99.2023.02.23.03.04.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 03:04:37 -0800 (PST) Received-SPF: pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org header.s=default header.b=qkG1RQ9E; spf=pass (google.com: domain of binutils-bounces+ouuuleilei=gmail.com@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="binutils-bounces+ouuuleilei=gmail.com@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 3EEBF385842B for ; Thu, 23 Feb 2023 11:04:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3EEBF385842B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1677150274; bh=m24yXh3lQ+xYjluJw/+M/f+ObIG+L9xqsPSKFfEMk9g=; h=To:Cc:Subject:Date:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From:Reply-To:From; b=qkG1RQ9E6xlgVkCDKR3loO1/f6TOmaWapV0i7kYa3UL1RZehjDkViTWdeWc/lIUk6 lGkLy078tBvhBJO/bxV+liX7id9zs4eRCFDiHj2Cb26quF0+fGth6I0Np1/3vn0GaP CAN1Md2b8eNBBJlapF19ROr0HoXu7bbpkR7h3++w= X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from mail-wr1-x436.google.com (mail-wr1-x436.google.com [IPv6:2a00:1450:4864:20::436]) by sourceware.org (Postfix) with ESMTPS id 7E6683858439 for ; Thu, 23 Feb 2023 11:04:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7E6683858439 Received: by mail-wr1-x436.google.com with SMTP id 6so9957454wrb.11 for ; Thu, 23 Feb 2023 03:04:22 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=m24yXh3lQ+xYjluJw/+M/f+ObIG+L9xqsPSKFfEMk9g=; b=bMNbDIIgSfq7rAhLrwr//PCCa7mLaFzeZ0/IZBpwS1f6Z0Uo2xigFBmoRiWd6Cc1sX JJLUdZr08aX+TyorgwrR9Q2/mljmivszHVeeXwdu592A72j/mEUNaHml8qQ4RHVRTpTs XwAz5jGy7y6UC8lcmtBrNKro8k18DHuL2nHgO8vznUqtK+Lcyc8Xke4FUKS3RN9Vq8NJ zkwhA0dnQT6qaVX83aEqhXOXy35Oo/kQMasc8Wb5irCKHLjiABf6TTbJN1POJysw+vHj PBF2beMsIIv5QKm/lYpBMFUL847xlGBdq9eCj1jG++aglRhP8xa8ZL+pz4TpHVxAveeV 21EA== X-Gm-Message-State: AO0yUKW4FFiydgQhSMsXqE9016OHWhN98icD4Wd2XbGDNexB7zB2SAuG r7jayP4ECDjoKTI2gwWNp9e/hHkpDFAYyHw3 X-Received: by 2002:adf:ef0d:0:b0:2c5:587e:75ba with SMTP id e13-20020adfef0d000000b002c5587e75bamr9518505wro.55.1677150261029; Thu, 23 Feb 2023 03:04:21 -0800 (PST) Received: from chigot-Dell.home ([2a01:cb15:8123:8100:34f2:8b0c:5cc3:b9ab]) by smtp.gmail.com with ESMTPSA id m17-20020a05600c3b1100b003e896d953a8sm6635349wms.17.2023.02.23.03.04.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Feb 2023 03:04:20 -0800 (PST) To: binutils@sourceware.org Cc: jbeulich@suse.com, schwab@suse.de, amodra@gmail.com, =?utf-8?q?Cl=C3=A9m?= =?utf-8?q?ent_Chigot?= Subject: [PATCH v3] testsuite: prune DOS drive letter in test outputs Date: Thu, 23 Feb 2023 12:04:17 +0100 Message-Id: <20230223110417.63915-1-chigot@adacore.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham 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.29 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: =?utf-8?q?Cl=C3=A9ment_Chigot_via_Binutils?= From: =?utf-8?q?Cl=C3=A9ment_Chigot?= Reply-To: =?utf-8?q?Cl=C3=A9ment_Chigot?= Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org Sender: "Binutils" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1758457863532088733?= X-GMAIL-MSGID: =?utf-8?q?1758619528951052037?= On DOS systems, absolute paths start with the drive letter. This can trigger failures in the regexp from dump tests, especially for those checking for warnings or errors. They are usually skipping everything before the first ":" as it has to be the file path. | [^:]*: warning: ... In order to avoid modifying many regexps to allow such drive letters, prune them from all the outputs if they are found at the beginning of a line. binutils/ChangeLog: * testsuite/lib/binutils-common.exp (prune_dump_output): New (run_dump_test): Use it. ld/ChangeLog: * testsuite/ld-elf/noinit-sections-2.l: Remove DOS drive letter handler. --- binutils/testsuite/lib/binutils-common.exp | 18 +++++++++++++++++- ld/testsuite/ld-elf/noinit-sections-2.l | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/binutils/testsuite/lib/binutils-common.exp b/binutils/testsuite/lib/binutils-common.exp index ab752417295..530316e54cd 100644 --- a/binutils/testsuite/lib/binutils-common.exp +++ b/binutils/testsuite/lib/binutils-common.exp @@ -687,6 +687,22 @@ if ![string length [info proc prune_warnings]] { } } +# prune_dump_output OUTPUT +# +# Clean up the output from system specific or unwanted characters. +# This allows to simplify the regexp inside dump tests. +proc prune_dump_output { output } { + if [ishost "*-*-mingw*"] { + # Prune DOS drive letter from an absolute path if it appears + # at the beginning of a line. + regsub -all {(^|\n)[[:alpha:]]:(/|\\)} $output "\\1\\2" output + } + + # Prune last end of line. + regsub "\n$" $output "" output + return $output +} + # run_dump_test FILE (optional:) EXTRA_OPTIONS # # Assemble a .s file, then run some utility on it and check the output. @@ -1450,7 +1466,7 @@ proc run_dump_test { name {extra_options {}} } { } } - regsub "\n$" $comp_output "" comp_output + set comp_output [prune_dump_output $comp_output] if { $cmdret != 0 || $comp_output != "" || $want_out(source) != "" } { set exitstat "succeeded" if { $cmdret != 0 } { set exitstat "failed" } diff --git a/ld/testsuite/ld-elf/noinit-sections-2.l b/ld/testsuite/ld-elf/noinit-sections-2.l index 8ed2716c549..0784c9e3e12 100644 --- a/ld/testsuite/ld-elf/noinit-sections-2.l +++ b/ld/testsuite/ld-elf/noinit-sections-2.l @@ -1,5 +1,5 @@ #... -(|.:)[^:]*: warning: orphan section `.noinit.var_noinit' from \S+ being placed in section `.noinit.var_noinit' +[^:]*: warning: orphan section `.noinit.var_noinit' from \S+ being placed in section `.noinit.var_noinit' #... -(|.:)[^:]*: warning: orphan section `.gnu.linkonce.n.var_noinit2' from \S+ being placed in section `.gnu.linkonce.n.var_noinit2' +[^:]*: warning: orphan section `.gnu.linkonce.n.var_noinit2' from \S+ being placed in section `.gnu.linkonce.n.var_noinit2' #pass