OSDN Git Service

2003-12-16 Paolo Carlini <pcarlini@suse.de>
authorpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Dec 2003 22:57:57 +0000 (22:57 +0000)
committerpaolo <paolo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 16 Dec 2003 22:57:57 +0000 (22:57 +0000)
* testsuite/performance/container_benchmark.cc: New, a
benchmark developed by Bjarne Stroustrup and Alexander
Stepanov and made available with no restrictions.

* testsuite/testsuite_performance.h (report_header): New,
useful to produce header lines in the reports.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74717 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/testsuite/testsuite_performance.h

index 9ec2f86..a736fcf 100644 (file)
@@ -197,6 +197,25 @@ namespace __gnu_test
     out << std::endl;
     out.close();
   }
+
+  void
+  report_header(const std::string file, const std::string header)
+  {
+    const char space = ' ';
+    const char tab = '\t';
+    const char* name = "libstdc++-performance.sum";
+    std::string::const_iterator i = file.begin() + file.find_last_of('/') + 1;
+    std::string testname(i, file.end());
+
+    std::ofstream out(name, std::ios_base::app);
+
+    out.setf(std::ios_base::left);
+    out << std::setw(25) << testname << tab;
+    out << std::setw(25) << header << tab;
+
+    out << std::endl;
+    out.close();
+  }
 }; // namespace __gnu_test
 
 #endif // _GLIBCXX_PERFORMANCE_H