27 #ifndef _CEGUITestsPerformanceTest_h_
28 #define _CEGUITestsPerformanceTest_h_
30 #include <boost/timer/timer.hpp>
33 #include "CEGUI/WindowManager.h"
54 <<
"Running performance test " << d_testName <<
"..." << std::endl;
56 boost::timer::auto_cpu_timer timer;
60 logRunningTime(boost::timer::format(timer.elapsed(), timer.places(),
"%u, %w"));
64 virtual void doTest() = 0;
67 void logRunningTime(std::string result)
69 std::ofstream fout(
"performance-test-results.csv",
70 std::ofstream::out | std::ofstream::app);
73 fout.seekp(0, std::ios::end);
74 const std::streamoff length = fout.tellp();
77 fout <<
"test name, user time (seconds), wall time (seconds)" << std::endl;
80 fout << d_testName <<
", " << result << std::endl;
91 template<
typename TWindow>
99 d_window =
static_cast<TWindow*
>(
101 window_type, window_type +
"-perf-test"));
102 d_window->setWindowRenderer(renderer);
105 virtual void render()
121 template<
typename TWindow>
130 virtual void doTest()
139 deleteFirstItems(150);
142 for (
size_t step = 0; step < 17; ++step)
148 deleteLastItems(123);
156 for (
size_t i = 0; i < 50; ++i)
169 for (
size_t i = 0; i < count; ++i)
176 virtual void clearItems() = 0;
177 virtual void addItems(
size_t count) = 0;
178 virtual void addItems(
size_t count,
size_t at_position) = 0;
179 virtual void deleteFirstItems(
size_t count) = 0;
180 virtual void deleteLastItems(
size_t count) = 0;
181 virtual void sortItems() = 0;
Window * createWindow(const String &type, const String &name="")
Creates a new Window object of the specified type, and gives it the specified unique name...
Definition: WindowManager.cpp:96
String class used within the GUI system.
Definition: cegui/include/CEGUI/String.h:62