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]

RFA: Avoid simulator timeouts on more libstdc++ tests


This patch uses the same idiom used elsewhere in the testsuite to
condition the size of some tests for simulators.  Running through a
stream inserting twenty million characters in simulation can easily
trip the 5-minute timeout, for example.

OK to apply?

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

2009-03-20  Mark Mitchell  <mark@codesourcery.com>

	libstdc++/
	* testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc
	Condition stream width for simulators.
	* testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc:
	Likewise.
	* testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc:
	Likewise.
	* testsuite/ext/vstring/inserters_extractors/char/28277.cc: Likewise.
	* testsuite/25_algorithms/search_n/iterator.cc: Condition
	iterations for simulators.

Index: libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc
===================================================================
--- libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc	(revision 240572)
+++ libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-3.cc	(working copy)
@@ -18,12 +18,18 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-options "-DWIDTH=200000" { target simulator } }
+
 // 27.6.2.5.4 basic_ostream character inserters
 
 #include <ostream>
 #include <sstream>
 #include <testsuite_hooks.h>
 
+#ifndef WIDTH
+#define WIDTH 20000000
+#endif
+
 // libstdc++/28277
 void test01()
 {
@@ -32,7 +38,7 @@ void test01()
 
   ostringstream oss_01;
 
-  oss_01.width(20000000);
+  oss_01.width(WIDTH);
   const streamsize width = oss_01.width();
 
   oss_01 << 'a';
Index: libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc
===================================================================
--- libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc	(revision 240572)
+++ libstdc++-v3/testsuite/27_io/basic_ostream/inserters_character/char/28277-4.cc	(working copy)
@@ -18,12 +18,18 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-options "-DWIDTH=200000" { target simulator } }
+
 // 27.6.2.5.4 basic_ostream character inserters
 
 #include <ostream>
 #include <sstream>
 #include <testsuite_hooks.h>
 
+#ifndef WIDTH
+#define WIDTH 20000000
+#endif
+
 // libstdc++/28277
 void test01()
 {
@@ -33,7 +39,7 @@ void test01()
   ostringstream oss_01;
   const string str_01(50, 'a');
 
-  oss_01.width(20000000);
+  oss_01.width(WIDTH);
   const streamsize width = oss_01.width();
 
   oss_01 << str_01.c_str();
Index: libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc
===================================================================
--- libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc	(revision 240572)
+++ libstdc++-v3/testsuite/25_algorithms/search_n/iterator.cc	(working copy)
@@ -16,6 +16,8 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-options "-DTEST_DEPTH=10" { target simulator } }
+
 // 25 algorithms, search_n
 
 #include <algorithm>
@@ -23,7 +25,10 @@
 #include <testsuite_hooks.h>
 #include <testsuite_iterators.h>
 
+#ifndef TEST_DEPTH
 #define TEST_DEPTH 14
+#endif
+
 int array1[11] = {0, 1, 0, 0, 1, 1, 0, 1, 1, 1, 0};
 int array2[TEST_DEPTH];
 
Index: libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc
===================================================================
--- libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc	(revision 240572)
+++ libstdc++-v3/testsuite/21_strings/basic_string/inserters_extractors/char/28277.cc	(working copy)
@@ -18,12 +18,18 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-options "-DWIDTH=200000" { target simulator } }
+
 // 21.3.7.9 inserters and extractors
 
 #include <ostream>
 #include <sstream>
 #include <testsuite_hooks.h>
 
+#ifndef WIDTH
+#define WIDTH 20000000
+#endif
+
 // libstdc++/28277
 void test01()
 {
@@ -33,7 +39,7 @@ void test01()
   ostringstream oss_01;
   const string str_01(50, 'a');
 
-  oss_01.width(20000000);
+  oss_01.width(WIDTH);
   const streamsize width = oss_01.width();
 
   oss_01 << str_01;
Index: libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc
===================================================================
--- libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc	(revision 240572)
+++ libstdc++-v3/testsuite/ext/vstring/inserters_extractors/char/28277.cc	(working copy)
@@ -18,11 +18,17 @@
 // Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
 // USA.
 
+// { dg-options "-DWIDTH=200000" { target simulator } }
+
 #include <ostream>
 #include <sstream>
 #include <ext/vstring.h>
 #include <testsuite_hooks.h>
 
+#ifndef WIDTH
+#define WIDTH 20000000
+#endif
+
 // libstdc++/28277
 void test01()
 {
@@ -32,7 +38,7 @@ void test01()
   ostringstream oss_01;
   const __gnu_cxx::__vstring str_01(50, 'a');
 
-  oss_01.width(20000000);
+  oss_01.width(WIDTH);
   const streamsize width = oss_01.width();
 
   oss_01 << str_01;


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