public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2] tests: force non-deterministic mode in non-deterministic tests
@ 2023-12-19 21:53 Stephen Kitt
  2023-12-20  8:03 ` Jan Beulich
  0 siblings, 1 reply; 8+ messages in thread
From: Stephen Kitt @ 2023-12-19 21:53 UTC (permalink / raw)
  To: binutils; +Cc: Stephen Kitt

Since ar can be built defaulting to deterministic mode, tests which
expect non-deterministic behaviour need to explicitly set the U flag.
They also need to run without SOURCE_DATE_EPOCH since that also
enables deterministic mode.

Signed-off-by: Stephen Kitt <steve@sk2.org>
---
 binutils/testsuite/binutils-all/ar.exp | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index aade419344e..3ac3c424447 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -571,6 +571,8 @@ proc replacing_non_deterministic_member { } {
 	return
     }
 
+    unsetenv SOURCE_DATE_EPOCH
+
     set archive tmpdir/artest.a
     set older_objfile tmpdir/bintest.${obj}
     set newer_objfile tmpdir/ar/bintest.${obj}
@@ -581,7 +583,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 +591,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 +653,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 +664,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


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-12-22 22:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-19 21:53 [PATCH v2] tests: force non-deterministic mode in non-deterministic tests Stephen Kitt
2023-12-20  8:03 ` Jan Beulich
2023-12-20 17:40   ` Stephen Kitt
2023-12-21  7:22     ` Jan Beulich
2023-12-21  8:13       ` Stephen Kitt
2023-12-21  8:34         ` Jan Beulich
2023-12-22 11:29         ` Jan Beulich
2023-12-22 22:03           ` Stephen Kitt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).