This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

PATCH: Add wrapper effective-target, XFAIL libstdc++ test


Nathan observed that we have various places in the testsuite where we
XFAIL tests based on targets (e.g., arm-eabi, m68k-elf) where the real
problem is that the tests fail with the testglue wrapper.  In other
words, the compiler works fine, the target system works fine, but the
testglue wrapper itself causes something to fail.

For example, 27_io/ios_base/sync_with_stdio/1.cc fails with the
testglue wrapper because it freopen's stdout.  Then, when the wrapper
goes to print its magic "EXIT 0" status message, that goes to the file
to which stdiout now points, and DejaGNU doesn't see the message.  So,
DejaGNU concludes the program crashed, and records a failure.

This patch adds an effective-target keyword for wrapped-ness, and uses
it to XFAIL the test above.  There are other tests that could and
should be converted to use this, rather than XFAIL'ing a list of
targets, but that's for another day.

I plan to commit this patch in 24 hours, if there are no objections.

--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713

2006-10-07  Nathan Sidwell  <nathan@codesourcery.com>

	* lib/target-supports.exp (check_effective_target_unwrapped): New.

2007-02-22  Mark Mitchell  <mark@codesourcery.com>

	* testsuite/27_io/ios_base/sync_with_stdio/1.cc: XFAIL for wrapped
	targets.

Index: gcc/testsuite/lib/target-supports.exp
===================================================================
--- gcc/testsuite/lib/target-supports.exp	(revision 151001)
+++ gcc/testsuite/lib/target-supports.exp	(revision 151050)
@@ -499,6 +499,16 @@ proc check_effective_target_fpic { } {
     return 1
 }
 
+# Return 1 if the target does not use a status wrapper.
+
+proc check_effective_target_unwrapped { } {
+    if { [target_info needs_status_wrapper] != "" \
+	     && [target_info needs_status_wrapper] != "0" } {
+	return 0
+    }
+    return 1
+}
+
 # Return true if iconv is supported on the target. In particular IBM1047.
 
 proc check_iconv_available { test_what } {
Index: libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc
===================================================================
--- libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc	(revision 163611)
+++ libstdc++-v3/testsuite/27_io/ios_base/sync_with_stdio/1.cc	(working copy)
@@ -24,6 +24,12 @@
 // @require@ %-*.tst
 // @diff@ %-*.tst %-*.txt
 
+// This test fails on platforms using a wrapper, because this test
+// redirects stdout to a file and so the exit status printed by the
+// wrapper is not visibile to DejaGNU.  DejaGNU then assumes that the
+// test exited with a non-zero exit status.
+// { dg-do run { xfail { ! unwrapped } } }
+
 #include <cstdio>
 #include <sstream>
 #include <iostream>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]