From patchwork Tue Jan 16 13:57:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephen Kitt X-Patchwork-Id: 188528 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:42cf:b0:101:a8e8:374 with SMTP id q15csp270118dye; Tue, 16 Jan 2024 05:58:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IGn52YPfDljJzuyvFH3tCIYVtnayUbZ6mO3KGQ6oaJ1aaqLDkEoj3yTCOg8nk66ByBKo40d X-Received: by 2002:a05:622a:1181:b0:42a:910:5af0 with SMTP id m1-20020a05622a118100b0042a09105af0mr542598qtk.121.1705413508757; Tue, 16 Jan 2024 05:58:28 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1705413508; cv=pass; d=google.com; s=arc-20160816; b=wo1GWLPXkUkVxFCX8TlVK5IxNRSRFLE5lttofVUiHAHohceLakfZK/pgnzS0f+MVTp bhmBfbb29H6/mrKQ134cfPSNMaPDgXtvhjFkKJ8i19fdq4yOL2rFUMZ3qts8fKYjvxnj PUEVk08LjuX76i80qs4YTUlAlc91IVW8zBlD61hygmf6EVNHN0A5EN1dvU9KjSRINTFV 34+BttTweaf8NXzGLZxLHfkcoSmN8jNe6D7ZZswdZX3eQNMED911JlbGYnWhCWKHnnyA M/nxS9wsLyDyochgOudu0SmyRz3OZNZxjlaMMlH1kEn860hz6RE2gmT3PyNUEqrpsSVA guqw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:arc-filter :dmarc-filter:delivered-to; bh=SOPjGvcieM8KK1v1VvtoStAiZn2vETKr81YgTzfLfPY=; fh=zZO4qmiHk93Pmi4u9DfquuNTtpmlNezw3XOhFWRg6ZE=; b=wT8dP/O2/sJ+p/kmJv+CdnO6fHrLpYQhYoJIc3reaFzURUxpqyrFO+536UjJW3Z5Fh wBWYLA0cNdBdD33cv2p2j0urMXcPt9mvqtsJ1l/gH/4EI/GKcTh8avTY1sKkNlT5oK9a FYmBPxTS47VgxvcBDK8NOqsJD/5KFHAwu1c81ubktC1Xy7tnyYrmRC6kURhji3Gev3dc IfUigJswJ7icoBnL8qWL6BhIJVUWBEGrbQ+7Djqg6sTso00WKi/QD2r5ko2un/nANXQT feHOmwrH+0KOhpfL9K3T+tud2njGt3oVh5MZ1dcsDeYVDdavR/NXEPZFUGQQ4sho8SuJ k5ag== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); 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" Received: from server2.sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id f6-20020ac85d06000000b004298a42d1fesi10615020qtx.661.2024.01.16.05.58.28 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 05:58:28 -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; arc=pass (i=1); 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7486C385840A for ; Tue, 16 Jan 2024 13:58:28 +0000 (GMT) X-Original-To: binutils@sourceware.org Delivered-To: binutils@sourceware.org Received: from 11.mo582.mail-out.ovh.net (11.mo582.mail-out.ovh.net [188.165.38.119]) by sourceware.org (Postfix) with ESMTPS id 95C613858D35 for ; Tue, 16 Jan 2024 13:57:48 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 95C613858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=sk2.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=sk2.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 95C613858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=188.165.38.119 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705413471; cv=none; b=gkL9TXvn7oHGyLFhjxcNoGhM7cTmSFUrbf/xgSq7z1KnRWZlSwcMR6L2HY4UZ4F6Z3jP3Nx3g+VJF70gi0eEJ50Bn2pUqqo7teYGcQ+Cln16n/Y4eV3UqGZ0XiNhu1162kQO0jmTs1xyqqvUkIikoha3Fzy1uW8aZ+S0E/gb8hc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705413471; c=relaxed/simple; bh=dQTpp6xQACWoDdR+2/TqX9yoTrZNec3gloSJhLhP6Lo=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=Bz3A0J2W5uzs7EO8QXhwO8jLpNpaRSaRU7dL87xPS5cCHU2OXZBUXDAv2hctl6K/D5THknX8lqVRHgQK14jf3xx+0P4v7/iqULVvU2HND62RmkFCQbZAIP8gk+SzDNR4moJcdmQhgGAW5bPulj1F4IeZTUsmS8M7CA1Q3fNWuKA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from director3.ghost.mail-out.ovh.net (unknown [10.109.139.163]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 4AB17299C8 for ; Tue, 16 Jan 2024 13:57:47 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-pnccg (unknown [10.110.96.193]) by director3.ghost.mail-out.ovh.net (Postfix) with ESMTPS id D485E1FECD; Tue, 16 Jan 2024 13:57:46 +0000 (UTC) Received: from sk2.org ([37.59.142.97]) by ghost-submission-6684bf9d7b-pnccg with ESMTPSA id IwXjHVqLpmUlhwEAtHybKA (envelope-from ); Tue, 16 Jan 2024 13:57:46 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-97G002dafd4d9b-a6c9-4ca5-92df-5cc56ef35426, 35E6A564D9274F5E49FF7EA934B04499BBE63940) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: binutils@sourceware.org Cc: Stephen Kitt Subject: [PATCH v3] tests: force non-deterministic mode in non-deterministic tests Date: Tue, 16 Jan 2024 14:57:29 +0100 Message-Id: <20240116135729.2479347-1-steve@sk2.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Ovh-Tracer-Id: 10041619794570479238 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvkedrvdejfedgheekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeelgeetueejffejfeejvefhtddufeejgfetleegtddukeelieelvddvteduveejtdenucfkphepuddvjedrtddrtddruddpkedvrdeihedrvdehrddvtddupdefjedrheelrddugedvrdeljeenucfuphgrmhfkphfpvghtfihorhhkpeekvddrieehrddvhedrvddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehsthgvvhgvsehskhdvrdhorhhgqedpnhgspghrtghpthhtohepuddprhgtphhtthhopegsihhnuhhtihhlshesshhouhhrtggvfigrrhgvrdhorhhgpdfovfetjfhoshhtpehmohehkedvpdhmohguvgepshhmthhpohhuth X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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.30 Precedence: list List-Id: Binutils mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: binutils-bounces+ouuuleilei=gmail.com@sourceware.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1788255675728581096 X-GMAIL-MSGID: 1788255675728581096 Since ar can be built defaulting to deterministic mode, tests which expect non-deterministic behaviour need to explicitly set the U flag. The non-deterministic member test expects SOURCE_DATE_EPOCH to not be set; this documents that. Unconditionally unsetting the variable causes issues in test infrastructure (which expects unsetenv to only be called on variables which are already set). Signed-off-by: Stephen Kitt --- binutils/testsuite/binutils-all/ar.exp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) base-commit: c4fb39bb31a53bbb2df3be3200d694f025c5b892 diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp index aade419344e..4712bb2bc71 100644 --- a/binutils/testsuite/binutils-all/ar.exp +++ b/binutils/testsuite/binutils-all/ar.exp @@ -538,6 +538,7 @@ proc replacing_deterministic_member { } { } # Test replacing a member of a non-deterministic archive. +# This test expects SOURCE_DATE_EPOCH to not be set in the environment. proc replacing_non_deterministic_member { } { global AR @@ -581,7 +582,7 @@ proc replacing_non_deterministic_member { } { # Build the archive with the *newer* object file. - set got [binutils_run $AR "rc $archive ${newer_objfile}"] + set got [binutils_run $AR "rcU $archive ${newer_objfile}"] if ![string match "" $got] { fail "$testname: (could not build archive)" return @@ -589,7 +590,7 @@ proc replacing_non_deterministic_member { } { # Now try to replace the newer file with the older one. This should not work. - set got [binutils_run $AR "ru $archive $older_objfile"] + set got [binutils_run $AR "ruU $archive $older_objfile"] if ![string match "" $got] { fail "$testname: (failed to replace file)" return @@ -651,7 +652,7 @@ proc replacing_sde_deterministic_member { } { # Build the archive with the *newer* object file. setenv SOURCE_DATE_EPOCH "1000" - set got [binutils_run $AR "rc $archive ${newer_objfile}"] + set got [binutils_run $AR "rcU $archive ${newer_objfile}"] if ![string match "" $got] { fail "$testname: (could not build archive)" unsetenv SOURCE_DATE_EPOCH @@ -662,7 +663,7 @@ proc replacing_sde_deterministic_member { } { # archive this will not work, but one created to be deterministic # should always replace its members. - set got [binutils_run $AR "ru $archive $older_objfile"] + set got [binutils_run $AR "ruU $archive $older_objfile"] if ![string match "" $got] { fail "$testname: (failed to replace file)" unsetenv SOURCE_DATE_EPOCH