Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_CppTest / INC / cpptest-collectoroutput.h
diff --git a/WCudaMSE/API_CppTest/INC/cpptest-collectoroutput.h b/WCudaMSE/API_CppTest/INC/cpptest-collectoroutput.h
new file mode 100755 (executable)
index 0000000..61e51f8
--- /dev/null
@@ -0,0 +1,106 @@
+// ---\r
+//\r
+// $Id: cpptest-collectoroutput.h,v 1.3 2005/06/08 08:08:06 nilu Exp $\r
+//\r
+// CppTest - A C++ Unit Testing Framework\r
+// Copyright (c) 2003 Niklas Lundell\r
+//\r
+// ---\r
+//\r
+// This library is free software; you can redistribute it and/or\r
+// modify it under the terms of the GNU Lesser General Public\r
+// License as published by the Free Software Foundation; either\r
+// version 2 of the License, or (at your option) any later version.\r
+//\r
+// This library is distributed in the hope that it will be useful,\r
+// but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU\r
+// Lesser General Public License for more details.\r
+//\r
+// You should have received a copy of the GNU Lesser General Public\r
+// License along with this library; if not, write to the\r
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,\r
+// Boston, MA 02111-1307, USA.\r
+//\r
+// ---\r
+\r
+/** \file */\r
+\r
+#ifndef CPPTEST_COLLECTOROUTPUT_H\r
+#define CPPTEST_COLLECTOROUTPUT_H\r
+\r
+#include <list>\r
+#include <string>\r
+#include <vector>\r
+\r
+#include "cpptest-output.h"\r
+#include "cpptest-source.h"\r
+#include "cpptest-time.h"\r
+\r
+namespace Test\r
+{\r
+       /// \brief Collector output.\r
+       ///\r
+       /// Base class for output handlers that need to report status when all\r
+       /// tests have executed.\r
+       ///\r
+       class CollectorOutput : public Output\r
+       {\r
+       public:\r
+               virtual void finished(int tests, const Time& time);\r
+               virtual void suite_start(int tests, const std::string& name);\r
+               virtual void suite_end(int tests, const std::string& name,\r
+                                                          const Time& time);\r
+               virtual void test_start(const std::string& name);\r
+               virtual void test_end(const std::string& name, bool ok,\r
+                                                         const Time& time);\r
+               virtual void assertment(const Source& s);\r
+               \r
+       protected:\r
+               struct OutputSuiteInfo;\r
+               struct OutputTestInfo;\r
+               struct OutputErrorTestInfo;\r
+               \r
+               typedef std::list<Source> Sources;\r
+               \r
+               struct TestInfo\r
+               {\r
+            std::string _name;\r
+                       Time            _time;\r
+                       \r
+                       bool            _success : 1;\r
+                       Sources         _sources;\r
+                       \r
+                       explicit TestInfo(const std::string name);\r
+               };\r
+               \r
+               typedef std::vector<TestInfo> Tests;\r
+               \r
+               struct SuiteInfo\r
+               {\r
+                       std::string     _name;\r
+                       int                     _errors;\r
+                       Tests           _tests;\r
+                       Time            _time;\r
+                       \r
+                       SuiteInfo(const std::string& name, int tests);\r
+               };\r
+               \r
+               typedef std::list<SuiteInfo> Suites;\r
+               \r
+               Suites                  _suites;\r
+               int                             _total_errors;\r
+               int                             _total_tests;\r
+               Time                    _total_time;\r
+               \r
+               CollectorOutput();\r
+               \r
+       private:\r
+               SuiteInfo*              _cur_suite;\r
+               TestInfo*               _cur_test;\r
+       };\r
+       \r
+} // namespace Test\r
+       \r
+#endif // #ifndef CPPTEST_COLLECTOROUTPUT_H\r
+\r