From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 Content-Transfer-Encoding: 8bit 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 List-Id: 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(-) 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 base-commit: c4fb39bb31a53bbb2df3be3200d694f025c5b892 -- 2.30.2