[2/2] binutils/testsuite: don't tail the same input and output file

Message ID 20250401075621.374954-2-chigot@adacore.com
State New
Headers
Series [1/2] binutils/testsuite: move objdump test output into tmpdir |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_binutils_build--master-arm fail Patch failed to apply
linaro-tcwg-bot/tcwg_binutils_build--master-aarch64 fail Patch failed to apply

Commit Message

Clément Chigot April 1, 2025, 7:56 a.m. UTC
  The output file could be created before the input is gathered by tail,
erasing the later before it's being proceeded.

This happened on rare cases when performing remote tests on
Ubuntu 24.04.
---
 binutils/testsuite/binutils-all/objdump.exp | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Jan Beulich April 1, 2025, 8:12 a.m. UTC | #1
On 01.04.2025 09:56, Clément Chigot wrote:
> --- a/binutils/testsuite/binutils-all/objdump.exp
> +++ b/binutils/testsuite/binutils-all/objdump.exp
> @@ -595,8 +595,8 @@ if { ![is_elf_format] } then {
>         send_log "\n"
>      }
>  
> -    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.out"]
> -    set output [remote_upload host tmpdir/objdump.out]
> +    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump-tailed.out"]
> +    set output [remote_upload host tmpdir/objdump-tailed.out]

For the sake of not making unnecessarily long names - maybe objdump.tail?
Just a preference - okay either way.

Jan
  
Clément Chigot April 1, 2025, 8:21 a.m. UTC | #2
On Tue, Apr 1, 2025 at 10:12 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 01.04.2025 09:56, Clément Chigot wrote:
> > --- a/binutils/testsuite/binutils-all/objdump.exp
> > +++ b/binutils/testsuite/binutils-all/objdump.exp
> > @@ -595,8 +595,8 @@ if { ![is_elf_format] } then {
> >         send_log "\n"
> >      }
> >
> > -    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.out"]
> > -    set output [remote_upload host tmpdir/objdump.out]
> > +    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump-tailed.out"]
> > +    set output [remote_upload host tmpdir/objdump-tailed.out]
>
> For the sake of not making unnecessarily long names - maybe objdump.tail?
> Just a preference - okay either way.

Pushed with your suggestion.
Thanks for the review !

Clément

> Jan
  

Patch

diff --git a/binutils/testsuite/binutils-all/objdump.exp b/binutils/testsuite/binutils-all/objdump.exp
index bddb0cb618a..47d08734f79 100644
--- a/binutils/testsuite/binutils-all/objdump.exp
+++ b/binutils/testsuite/binutils-all/objdump.exp
@@ -595,8 +595,8 @@  if { ![is_elf_format] } then {
        send_log "\n"
     }
 
-    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.out"]
-    set output [remote_upload host tmpdir/objdump.out]
+    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump-tailed.out"]
+    set output [remote_upload host tmpdir/objdump-tailed.out]
 
     if ![file size $output] then {
        # If the output file is empty, then this target does not
@@ -606,7 +606,7 @@  if { ![is_elf_format] } then {
        return
     }
 
-    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw5-op.W] } then {
+    if { [regexp_diff tmpdir/objdump-tailed.out $srcdir/$subdir/dw5-op.W] } then {
        fail "objdump -Wi for DW_OP_*"
     } else {
        pass "objdump -Wi for DW_OP_*"