]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
binutils/testsuite: move objdump test output into tmpdir
authorClément Chigot <chigot@adacore.com>
Mon, 31 Mar 2025 08:40:37 +0000 (10:40 +0200)
committerClément Chigot <chigot@adacore.com>
Tue, 1 Apr 2025 08:14:54 +0000 (10:14 +0200)
"objdump.out" is a testsuite trace and thus should be created within the
tmpdir.

binutils/testsuite/binutils-all/compress.exp
binutils/testsuite/binutils-all/objdump.exp

index 5db9417e170a6cb2295f28958164ae72b592222c..db167f0d30d75101e24d1bab5848c36896ce0d4b 100644 (file)
@@ -163,24 +163,24 @@ if ![string match "" $got] then {
 }
 
 set testname "objdump compress debug sections"
-set got [remote_exec host "$OBJDUMP -W ${compressedfile}.o" "" "/dev/null" "objdump.out"]
+set got [remote_exec host "$OBJDUMP -W ${compressedfile}.o" "" "/dev/null" "tmpdir/objdump.out"]
 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
     fail "$testname"
     send_log "$got\n"
 }
-if { [regexp_diff objdump.out $srcdir/$subdir/dw2-1.W] } then {
+if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw2-1.W] } then {
     fail "$testname"
 } else {
     pass "$testname"
 }
 
 set testname "objdump compress debug sections 3"
-set got [remote_exec host "$OBJDUMP -W ${compressedfile3}.o" "" "/dev/null" "objdump.out"]
+set got [remote_exec host "$OBJDUMP -W ${compressedfile3}.o" "" "/dev/null" "tmpdir/objdump.out"]
 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
     fail "$testname"
     send_log "$got\n"
 }
-if { [regexp_diff objdump.out $srcdir/$subdir/dw2-3.W] } then {
+if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw2-3.W] } then {
     fail "$testname"
 } else {
     pass "$testname"
@@ -565,12 +565,12 @@ if ![string match "" $got] then {
 }
 
 set testname "objdump compress debug sections 3 with zlib-gabi"
-set got [remote_exec host "$OBJDUMP -W ${compressedfile3}gabi.o" "" "/dev/null" "objdump.out"]
+set got [remote_exec host "$OBJDUMP -W ${compressedfile3}gabi.o" "" "/dev/null" "tmpdir/objdump.out"]
 if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
     fail "$testname"
     send_log "$got\n"
 }
-if { [regexp_diff objdump.out $srcdir/$subdir/dw2-3gabi.W] } then {
+if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw2-3gabi.W] } then {
     fail "$testname"
 } else {
     pass "$testname"
@@ -639,7 +639,7 @@ proc convert_test { testname  as_flags  objcop_flags } {
        return
     }
 
-    set got [remote_exec host "$OBJDUMP -W ${copyfile}.o" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP -W ${copyfile}.o" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "$testname (reason: unexpected output)"
@@ -648,7 +648,7 @@ proc convert_test { testname  as_flags  objcop_flags } {
        return
     }
 
-    if { [regexp_diff objdump.out $srcdir/$subdir/dw2-3.W] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw2-3.W] } then {
        fail "$testname"
     } else {
        pass "$testname"
index 76ee30f8ed96bbdf995873549d9b06bbabacef5a..bddb0cb618a6a4adc7a3e83e34afd9b592e87d3b 100644 (file)
@@ -454,7 +454,7 @@ if { ![is_elf_format] } then {
        set compressed_testfile tmpdir/dw2-compressed.${obj}
     }
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -s -j .zdebug_abbrev $compressed_testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -s -j .zdebug_abbrev $compressed_testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -s -j .zdebug_abbrev (reason: unexpected output)"
@@ -462,7 +462,7 @@ if { ![is_elf_format] } then {
        send_log "\n"
     }
 
-    if { [regexp_diff objdump.out $srcdir/$subdir/objdump.s] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/objdump.s] } then {
        fail "objdump -s -j .zdebug_abbrev"
     } else {
        pass "objdump -s -j .zdebug_abbrev"
@@ -470,7 +470,7 @@ if { ![is_elf_format] } then {
 
     # Test objdump -W on a file that contains some compressed .debug sections
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -W $compressed_testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -W $compressed_testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -W (reason: unexpected output)"
@@ -478,7 +478,7 @@ if { ![is_elf_format] } then {
        send_log "\n"
     }
 
-    if { [regexp_diff objdump.out $srcdir/$subdir/objdump.W] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/objdump.W] } then {
        fail "objdump -W"
     } else {
        pass "objdump -W"
@@ -486,7 +486,7 @@ if { ![is_elf_format] } then {
 
     # Test objdump -Z -s on a file that contains some compressed .debug sections
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Z -s -j .zdebug_abbrev $compressed_testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Z -s -j .zdebug_abbrev $compressed_testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -Z -s (reason: unexpected output)"
@@ -494,7 +494,7 @@ if { ![is_elf_format] } then {
        send_log "\n"
     }
 
-    if { [regexp_diff objdump.out $srcdir/$subdir/objdump.Zs] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/objdump.Zs] } then {
        fail "objdump -Z -s"
     } else {
        pass "objdump -Z -s"
@@ -530,7 +530,7 @@ if { ![is_elf_format]
        set decodedline_testfile tmpdir/dw2-decodedline.${obj}
     }
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -WL $decodedline_testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -WL $decodedline_testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -WL (reason: unexpected output)"
@@ -538,7 +538,7 @@ if { ![is_elf_format]
        send_log "\n"
     }
 
-    if { [regexp_diff objdump.out $srcdir/$subdir/objdump.WL] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/objdump.WL] } then {
        fail "objdump -WL"
     } else {
        pass "objdump -WL"
@@ -558,7 +558,7 @@ if { ![is_elf_format] } then {
        set ranges_testfile tmpdir/dw2-ranges.${obj}
     }
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS --dwarf=Ranges $ranges_testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS --dwarf=Ranges $ranges_testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -W for debug_ranges (reason: unexpected output)"
@@ -567,7 +567,7 @@ if { ![is_elf_format] } then {
     }
 
     setup_xfail "msp430-*-*"
-    if { [regexp_diff objdump.out $srcdir/$subdir/dw2-ranges.W] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw2-ranges.W] } then {
        fail "objdump -W for debug_ranges"
     } else {
        pass "objdump -W for debug_ranges"
@@ -587,7 +587,7 @@ if { ![is_elf_format] } then {
        set op_testfile tmpdir/dw5-op.${obj}
     }
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wi $op_testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wi $op_testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -Wi (reason: unexpected output)"
@@ -595,8 +595,8 @@ if { ![is_elf_format] } then {
        send_log "\n"
     }
 
-    set got [remote_exec host "tail -n +4 objdump.out" "" "/dev/null" "objdump.out"]
-    set output [remote_upload host objdump.out]
+    set got [remote_exec host "tail -n +4 tmpdir/objdump.out" "" "/dev/null" "tmpdir/objdump.out"]
+    set output [remote_upload host tmpdir/objdump.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 objdump.out $srcdir/$subdir/dw5-op.W] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/dw5-op.W] } then {
        fail "objdump -Wi for DW_OP_*"
     } else {
        pass "objdump -Wi for DW_OP_*"
@@ -712,7 +712,7 @@ if { [is_elf_format] } then {
        set testfile tmpdir/debuglink.${obj}
     }
 
-    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wk -WN $testfile" "" "/dev/null" "objdump.out"]
+    set got [remote_exec host "$OBJDUMP $OBJDUMPFLAGS -Wk -WN $testfile" "" "/dev/null" "tmpdir/objdump.out"]
 
     if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then {
        fail "objdump -Wk (reason: unexpected output)"
@@ -720,7 +720,7 @@ if { [is_elf_format] } then {
        send_log "\n"
     }
 
-    if { [regexp_diff objdump.out $srcdir/$subdir/objdump.Wk] } then {
+    if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/objdump.Wk] } then {
        fail "objdump -Wk (reason: output does not match expectations)"
     } else {
        pass "objdump -Wk"
@@ -764,7 +764,7 @@ proc test_follow_debuglink { options dumpfile } {
 
     if { [regexp_diff tmpdir/objdump.out $srcdir/$subdir/$dumpfile] } then {
        fail $test
-       verbose "output is \n[file_contents objdump.out]" 2
+       verbose "output is \n[file_contents tmpdir/objdump.out]" 2
        return
     }