public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Fix oopsie in ld-plugin tests.
@ 2010-10-14  5:01 Dave Korn
       [not found] ` <C8993F1F-854C-4D53-8B31-07B2561A9326@adacore.com>
  2010-10-15 18:10 ` Hans-Peter Nilsson
  0 siblings, 2 replies; 11+ messages in thread
From: Dave Korn @ 2010-10-14  5:01 UTC (permalink / raw)
  To: binutils, Hans-Peter Nilsson

[-- Attachment #1: Type: text/plain, Size: 628 bytes --]


    Good morning list,


  H-P pointed out to me that I overlooked to avoid returning an "ERROR:" in
the testsuite results when there is no target compiler available.  Sorry for
cluttering up your overnight test results.  The attached patch copies a test
that I have in fact seen before and should have thought of, and uses it to
mark the tests "UNSUPPORTED:" if no target compiler is available.

ld/testsuite/ChangeLog:

	* ld-plugin/plugin.exp: Don't error out if there is no target compiler
	available, make tests UNSUPPORTED instead.

  I don't know if it counts as obvious, though.  OK to commit?

    cheers,
      DaveK

[-- Attachment #2: tests-fix.diff --]
[-- Type: text/x-c, Size: 1598 bytes --]

diff --git a/ld/testsuite/ld-plugin/plugin.exp b/ld/testsuite/ld-plugin/plugin.exp
index 796cb0e..416159a 100644
--- a/ld/testsuite/ld-plugin/plugin.exp
+++ b/ld/testsuite/ld-plugin/plugin.exp
@@ -24,6 +24,13 @@ if ![check_plugin_api_available] {
     return
 }
 
+# And a compiler to be available.
+set can_compile 1
+if { [which $CC] == 0 } {
+  # Don't fail immediately, 
+  set can_compile 0
+}
+
 pass "plugin API enabled"
 
 global base_dir
@@ -62,12 +69,15 @@ set regcln "-plugin-opt registercleanup"
 set failed_compile 0
 set _ ""
 set plugin_nm_output ""
-if { ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o]
-	|| ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o]
-	|| ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/text.c tmpdir/text.o] } {
+if { $can_compile && \
+	(![ld_compile "$CC $CFLAGS" $srcdir/$subdir/main.c tmpdir/main.o] \
+	|| ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/func.c tmpdir/func.o] \
+	|| ![ld_compile "$CC $CFLAGS" $srcdir/$subdir/text.c tmpdir/text.o]) } {
     # Defer fail until we have list of tests set.
     set failed_compile 1
-} else {
+}
+
+if { $can_compile && !$failed_compile } {
     # Find out if symbols have prefix on this platform before setting tests.
     catch "exec $NM tmpdir/func.o" plugin_nm_output
     if { [regexp "_func" "$plugin_nm_output"] } {
@@ -142,7 +152,7 @@ set plugin_extra_elf_tests [list \
 				{readelf -s plugin-vis-1.d}} "main.x" ] \
 ]
 
-if { $failed_compile != 0 } {
+if { !$can_compile || $failed_compile } {
     foreach testitem $plugin_tests {
 	unresolved [lindex $testitem 0]
     }

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

end of thread, other threads:[~2010-10-21  2:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-14  5:01 [PATCH] Fix oopsie in ld-plugin tests Dave Korn
     [not found] ` <C8993F1F-854C-4D53-8B31-07B2561A9326@adacore.com>
2010-10-14 13:51   ` Dave Korn
2010-10-14 13:56     ` Tristan Gingold
2010-10-15 18:10 ` Hans-Peter Nilsson
2010-10-15 18:55   ` Dave Korn
2010-10-15 19:02     ` Hans-Peter Nilsson
2010-10-15 19:24       ` [PATCH, take 2] Fix ld-plugin testsuite noise properly [was Re: [PATCH] Fix oopsie in ld-plugin tests.] Dave Korn
2010-10-19 13:13         ` Hans-Peter Nilsson
2010-10-19 23:45           ` Alan Modra
2010-10-20 14:41             ` Dave Korn
2010-10-21  2:14               ` Alan Modra

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).