tests: force non-deterministic mode in non-deterministic tests

Message ID 20231218201401.966374-1-steve@sk2.org
State New
Headers
Series tests: force non-deterministic mode in non-deterministic tests |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm success Testing passed
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_binutils_check--master-arm success Testing passed

Commit Message

Stephen Kitt Dec. 18, 2023, 8:14 p.m. UTC
  Since ar can be built defaulting to deterministic mode, tests which
expect non-deterministic behaviour need to explicitly set the U flag.

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


base-commit: c4fb39bb31a53bbb2df3be3200d694f025c5b892
  

Comments

Jan Beulich Dec. 19, 2023, 10:30 a.m. UTC | #1
On 18.12.2023 21:14, Stephen Kitt wrote:
> Since ar can be built defaulting to deterministic mode, tests which
> expect non-deterministic behaviour need to explicitly set the U flag.
> 
> Signed-off-by: Stephen Kitt <steve@sk2.org>

Okay. I assume this wants committing on your behalf?

Jan
  
Stephen Kitt Dec. 19, 2023, 9:51 p.m. UTC | #2
On Tue, 19 Dec 2023 11:30:28 +0100, Jan Beulich <jbeulich@suse.com> wrote:
> On 18.12.2023 21:14, Stephen Kitt wrote:
> > Since ar can be built defaulting to deterministic mode, tests which
> > expect non-deterministic behaviour need to explicitly set the U flag.
> > 
> > Signed-off-by: Stephen Kitt <steve@sk2.org>  
> 
> Okay. I assume this wants committing on your behalf?

Yes please, but there’s a piece missing, I’ll send a v2 in a moment.

Regards,

Stephen
  

Patch

diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index aade419344e..e65cad8e695 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -581,7 +581,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 +589,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 +651,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 +662,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