public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@gmail.com>
To: binutils@sourceware.org
Subject: binutils testsuite: replace unresolved with unsupported
Date: Fri, 12 Feb 2021 18:59:02 +1030	[thread overview]
Message-ID: <20210212082902.GA5348@bubble.grove.modra.org> (raw)

You'd think "unresolved" would be correct for an objcopy test when the
assembler refuses to assemble one of our source files.  After all, the
test of objcopy hasn't been run.  However, "unresolved" results in
runtest returning with an error status.  If instead we report
"unsupported", runtest returns success.  Which is a little less
confusing to a user who doesn't see any errors reported unless they
look in log files.

	* testsuite/binutils-all/objcopy.exp: Report "unsupported" when
	gas or ld fails to build a testcase rather than "unresolved".
	Report "fail" when readelf returns an error status rather than
	"unresolved".
	* testsuite/binutils-all/ar.exp: Likewise.
	* testsuite/binutils-all/compress.exp: Likewise.
	* testsuite/binutils-all/readelf.exp: Likewise.

diff --git a/binutils/testsuite/binutils-all/ar.exp b/binutils/testsuite/binutils-all/ar.exp
index 6d640eab900..86f84242b28 100644
--- a/binutils/testsuite/binutils-all/ar.exp
+++ b/binutils/testsuite/binutils-all/ar.exp
@@ -195,7 +195,7 @@ proc symbol_table { } {
     set testname "ar symbol table"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -244,7 +244,7 @@ proc thin_archive { bfdtests } {
     set testname "ar thin archive"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -302,7 +302,7 @@ proc thin_archive_with_nested { bfdtests } {
     set testname "ar thin archive with nested archive"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -375,7 +375,7 @@ proc argument_parsing { } {
     set testname "ar argument parsing"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -412,7 +412,7 @@ proc deterministic_archive { } {
     set testname "ar deterministic archive"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -461,7 +461,7 @@ proc unique_symbol { } {
     set testname "ar unique symbol in archive"
 
     if ![binutils_assemble $srcdir/$subdir/unique.s tmpdir/unique.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -503,7 +503,7 @@ proc delete_an_element { } {
     set testname "ar deleting an element"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -545,7 +545,7 @@ proc move_an_element { } {
     set testname "ar moving an element"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -626,7 +626,7 @@ proc extract_an_element { } {
     set testname "ar extracting an element"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
@@ -686,7 +686,7 @@ proc many_files { } {
 
 	set ofile "tmpdir/d-$i.${obj}"
 	if ![binutils_assemble $sfile $ofile] {
-	    unresolved $testname
+	    unsupported $testname
 	    return
 	}
 
@@ -725,7 +725,7 @@ proc test_add_dependencies { } {
     set testname "ar adding library dependencies"
 
     if ![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.${obj}] {
-	unresolved $testname
+	unsupported $testname
 	return
     }
 
diff --git a/binutils/testsuite/binutils-all/compress.exp b/binutils/testsuite/binutils-all/compress.exp
index 7009bd53a04..e0e04f072e5 100644
--- a/binutils/testsuite/binutils-all/compress.exp
+++ b/binutils/testsuite/binutils-all/compress.exp
@@ -589,7 +589,7 @@ proc convert_test { testname  as_flags  objcop_flags } {
     global OBJDUMP
 
     if { ![binutils_assemble_flags $srcdir/$subdir/dw2-3.S ${testfile3}.o "$as_flags"] } then {
-       unresolved "$testname"
+       unsupported "$testname"
        return
     }
 
diff --git a/binutils/testsuite/binutils-all/objcopy.exp b/binutils/testsuite/binutils-all/objcopy.exp
index 8ccca36b3e4..ef251876a02 100644
--- a/binutils/testsuite/binutils-all/objcopy.exp
+++ b/binutils/testsuite/binutils-all/objcopy.exp
@@ -54,7 +54,7 @@ proc objcopy_test {testname srcfile type asflags ldflags} {
     }
 
     if {![binutils_assemble_flags $srcdir/$subdir/${srcfile} $t_tempfile "$asflags"]} then {
-	unresolved "objcopy $type ($testname)"
+	unsupported "objcopy $type ($testname)"
 	remote_file host delete $t_tempfile
 	return
     }
@@ -73,7 +73,7 @@ proc objcopy_test {testname srcfile type asflags ldflags} {
 	set t_copyfile $copyfile
 	set got [binutils_run $LD "$tempfile -o $t_tempfile $ldflags"]
 	if { ![string equal "" $got] } then {
-	    unresolved "objcopy $type ($testname)"
+	    unsupported "objcopy $type ($testname)"
 	    return
 	}
 	set xflags "--preserve-dates"
@@ -133,7 +133,7 @@ proc objcopy_test_verilog {testname} {
 
     set got [binutils_assemble $srcdir/$subdir/verilogtest.s $binfile]
     if {![binutils_assemble $srcdir/$subdir/verilogtest.s $binfile]} then {
-	unresolved "objcopy ($testname)"
+	unsupported "objcopy ($testname)"
 	return
     }
 
@@ -484,7 +484,7 @@ proc strip_test { } {
 	verbose -log "$READELF -a tmpdir/testprog.o > tmpdir/osabi.in"
 	set exec_output [remote_exec host "$READELF -h tmpdir/testprog.o" "" "/dev/null" "tmpdir/osabi.in"]
 	if { [lindex $exec_output 0] != 0 } then {
-	    unresolved "$test preserving OS/ABI"
+	    fail "$test preserving OS/ABI"
 	    set osabi_fail "true"
 	} else {
 	    verbose -log "grep OS/ABI tmpdir/osabi.in"
@@ -531,7 +531,7 @@ proc strip_test { } {
 	verbose -log "$READELF -a tmpdir/testprog.o > tmpdir/osabi.out"
 	set exec_output [remote_exec host "$READELF -h tmpdir/testprog.o" "" "/dev/null" "tmpdir/osabi.out"]
 	if { [lindex $exec_output 0] != 0 } then {
-	    unresolved "$test preserving OS/ABI"
+	    fail "$test preserving OS/ABI"
 	} else {
 	    verbose -log "grep OS/ABI tmpdir/osabi.out"
 	    catch "exec grep OS/ABI tmpdir/osabi.out" osabi_out
@@ -762,7 +762,7 @@ proc strip_executable { prog flags test1 test2 } {
 	verbose -log "$READELF -a ${copyfile} > tmpdir/osabi.in"
 	set exec_output [remote_exec host "$READELF -h ${copyfile}" "" "/dev/null" "tmpdir/osabi.in"]
 	if { [lindex $exec_output 0] != 0 } then {
-	    unresolved "$test1 preserving OS/ABI"
+	    fail "$test1 preserving OS/ABI"
 	    set osabi_fail "true"
 	} else {
 	    verbose -log "grep OS/ABI tmpdir/osabi.in"
@@ -788,7 +788,7 @@ proc strip_executable { prog flags test1 test2 } {
 	verbose -log "$READELF -a ${copyfile} > tmpdir/osabi.out"
 	set exec_output [remote_exec host "$READELF -h ${copyfile}" "" "/dev/null" "tmpdir/osabi.out"]
 	if { [lindex $exec_output 0] != 0 } then {
-	    unresolved "$test1 preserving OS/ABI"
+	    fail "$test1 preserving OS/ABI"
 	} else {
 	    verbose -log "grep OS/ABI tmpdir/osabi.out"
 	    catch "exec grep OS/ABI tmpdir/osabi.out" osabi_out
@@ -1021,7 +1021,7 @@ proc objcopy_test_readelf {testname srcfile} {
     global subdir
 
     if {![binutils_assemble $srcdir/$subdir/${srcfile} tmpdir/bintest.o]} then {
-	unresolved "objcopy ($testname)"
+	unsupported "objcopy ($testname)"
 	return
     }
 
@@ -1036,7 +1036,7 @@ proc objcopy_test_readelf {testname srcfile} {
     verbose -log "$READELF -a tmpdir/bintest.o > tmpdir/bintest.o.out"
     set exec_output [remote_exec host "$READELF -a tmpdir/bintest.o" "" "/dev/null" "tmpdir/bintest.o.out"]
     if { [lindex $exec_output 0] != 0 } then {
-	unresolved "objcopy ($testname)"
+	fail "objcopy ($testname)"
 	return
     }
     set exec_output [prune_warnings [lindex $exec_output 1]]
@@ -1048,7 +1048,7 @@ proc objcopy_test_readelf {testname srcfile} {
     verbose -log "$READELF -a tmpdir/copy.o > tmpdir/copy.o.out"
     set exec_output [remote_exec host "$READELF -a tmpdir/copy.o" "" "/dev/null" "tmpdir/copy.o.out"]
     if { [lindex $exec_output 0] != 0 } then {
-	unresolved "objcopy ($testname)"
+	fail "objcopy ($testname)"
 	return
     }
     set exec_output [prune_warnings [lindex $exec_output 1]]
@@ -1216,7 +1216,7 @@ if [is_elf_format] {
 	set srcfile $srcdir/$subdir/needed-by-reloc.s
 
 	if {![binutils_assemble $srcfile tmpdir/bintest.o]} then {
-	    unresolved $test
+	    unsupported $test
 	} else {
 	    set got [binutils_run $OBJCOPY "$OBJCOPYFLAGS --strip-symbol=foo tmpdir/bintest.o ${copyfile}.o"]
 
diff --git a/binutils/testsuite/binutils-all/readelf.exp b/binutils/testsuite/binutils-all/readelf.exp
index 51d26b762b3..948323c06bb 100644
--- a/binutils/testsuite/binutils-all/readelf.exp
+++ b/binutils/testsuite/binutils-all/readelf.exp
@@ -264,7 +264,7 @@ proc readelf_dump_test {} {
 
     # Assemble the dump test file.
     if {![binutils_assemble $srcdir/$subdir/dumptest.s tmpdir/dumptest.o]} then {
-      unresolved "readelf -p: failed to assemble dump test file"
+      unsupported "readelf -p: failed to assemble dump test file"
       return
     }
     # Download it.
@@ -324,10 +324,10 @@ send_user "Version [binutil_version $READELF]"
 
 # Assemble the test file.
 if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
-    unresolved "readelf -h bintest (failed to assemble)"
-    unresolved "readelf -S bintest (failed to assemble)"
-    unresolved "readelf -s bintest (failed to assemble)"
-    unresolved "readelf -r bintest (failed to assemble)"
+    unsupported "readelf -h bintest (failed to assemble)"
+    unsupported "readelf -S bintest (failed to assemble)"
+    unsupported "readelf -s bintest (failed to assemble)"
+    unsupported "readelf -r bintest (failed to assemble)"
     global readelf_size
     set readelf_size ""
 } else {
@@ -351,7 +351,7 @@ if {![binutils_assemble $srcdir/$subdir/bintest.s tmpdir/bintest.o]} then {
 
 # Test demangling symbol names.
 if {![binutils_assemble $srcdir/$subdir/mangled.s tmpdir/mangled.o]} then {
-    unresolved "readelf -s -C bintest (failed to assemble)"
+    unsupported "readelf -s -C bintest (failed to assemble)"
 } else {
 
     if ![is_remote host] {
@@ -380,7 +380,7 @@ if {[which $AS] != 0} then {
 
 # PR 13482 - Check for off-by-one errors when dumping .note sections.
 if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then {
-    unresolved "readelf -n version (failed to assemble)"
+    unsupported "readelf -n version (failed to assemble)"
 } else {
 
     if ![is_remote host] {
@@ -396,7 +396,7 @@ if {![binutils_assemble $srcdir/$subdir/version.s tmpdir/version.o]} then {
 # PR 18374 - Check that relocations against the .debug_loc section
 # do not prevent readelf from displaying all the location lists.
 if {![binutils_assemble $srcdir/$subdir/pr18374.s tmpdir/pr18374.o]} then {
-    unresolved "readelf --debug-dump=loc pr18374 (failed to assemble)"
+    unsupported "readelf --debug-dump=loc pr18374 (failed to assemble)"
 } else {
 
     if ![is_remote host] {
@@ -411,7 +411,7 @@ if {![binutils_assemble $srcdir/$subdir/pr18374.s tmpdir/pr18374.o]} then {
 
 # locview - Check dumping of location lists with location views.
 if {![binutils_assemble $srcdir/$subdir/locview-1.s tmpdir/locview-1.o]} then {
-    unresolved "readelf --debug-dump=loc locview-1 (failed to assemble)"
+    unsupported "readelf --debug-dump=loc locview-1 (failed to assemble)"
 } else {
 
     if ![is_remote host] {
@@ -423,7 +423,7 @@ if {![binutils_assemble $srcdir/$subdir/locview-1.s tmpdir/locview-1.o]} then {
     readelf_test --debug-dump=loc $tempfile readelf.locview-1  {}
 }
 if {![binutils_assemble $srcdir/$subdir/locview-2.s tmpdir/locview-2.o]} then {
-    unresolved "readelf --debug-dump=loc locview-2 (failed to assemble)"
+    unsupported "readelf --debug-dump=loc locview-2 (failed to assemble)"
 } else {
 
     if ![is_remote host] {
@@ -438,7 +438,7 @@ if {![binutils_assemble $srcdir/$subdir/locview-2.s tmpdir/locview-2.o]} then {
 
 # Check that decompressed dumps work.
 if {![binutils_assemble $srcdir/$subdir/z.s tmpdir/z.o]} then {
-    unresolved "readelf --decompress --hex-dump .debug_loc z (failed to assemble)"
+    unsupported "readelf --decompress --hex-dump .debug_loc z (failed to assemble)"
 } else {
 
     if ![is_remote host] {
@@ -461,7 +461,7 @@ if ![istarget "riscv*-*-*"] then {
 
     # Assemble the DWARF-5 test file.
     if {![binutils_assemble_flags $srcdir/$subdir/dw5.S tmpdir/dw5.o $hpux]} then {
-	unresolved "readelf -wiaoRlL dw5 (failed to assemble)"
+	unsupported "readelf -wiaoRlL dw5 (failed to assemble)"
     } else {
 
 	# Download it.
@@ -481,7 +481,7 @@ if ![istarget "riscv*-*-*"] then {
 
 # Assemble the DWARF-5 attributes test file.
 if {![binutils_assemble_flags $srcdir/$subdir/dwarf-attributes.S tmpdir/dwarf-attributes.o ""]} then {
-    unresolved "readelf -wi dwarf-attributes (failed to assemble)"
+    unsupported "readelf -wi dwarf-attributes (failed to assemble)"
 } else {
     # Download it.
     if ![is_remote host] {
@@ -499,7 +499,7 @@ if {![binutils_assemble_flags $srcdir/$subdir/dwarf-attributes.S tmpdir/dwarf-at
 
 # Check that debug link sections can be dumped.
 if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then {
-    unresolved "readelf --debug-dump=links (failed to assemble debuglink.s)"
+    unsupported "readelf --debug-dump=links (failed to assemble debuglink.s)"
 } else {
     if ![is_remote host] {
 	set tempfile tmpdir/debuglink.o
@@ -511,7 +511,7 @@ if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then {
 
     # Check that debug link sections can be followed.
     if {![binutils_assemble $srcdir/$subdir/linkdebug.s tmpdir/linkdebug.debug]} then {
-	unresolved "readelf --debug-dump=follow-links (failed to assemble linkdebug.s)"
+	unsupported "readelf --debug-dump=follow-links (failed to assemble linkdebug.s)"
     } else {
 	if [is_remote host] {
 	    set tempfile2 [remote_download host tmpdir/linkdebug.debug]
@@ -522,7 +522,7 @@ if {![binutils_assemble $srcdir/$subdir/debuglink.s tmpdir/debuglink.o]} then {
 }
 
 if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then {
-    unresolved "readelf --debug-dump=links (failed to assemble dwo.s)"
+    unsupported "readelf --debug-dump=links (failed to assemble dwo.s)"
 } else {
     if ![is_remote host] {
 	set tempfile tmpdir/dwo.o
@@ -534,7 +534,7 @@ if {![binutils_assemble $srcdir/$subdir/dwo.s tmpdir/dwo.o]} then {
 }
 
 if {![binutils_assemble $srcdir/$subdir/zero-sec.s tmpdir/zero-sec.o]} then {
-    unresolved "readelf --enable-checks (failed to assemble zero-sec.s)"
+    unsupported "readelf --enable-checks (failed to assemble zero-sec.s)"
 } else {
     if ![is_remote host] {
 	set tempfile tmpdir/zero-sec.o

-- 
Alan Modra
Australia Development Lab, IBM

                 reply	other threads:[~2021-02-12  8:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210212082902.GA5348@bubble.grove.modra.org \
    --to=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).