Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: client/deps/glbench/src/teartest.cc

Issue 2047001: Added teartest UI. (Closed) Base URL: ssh://git@chromiumos-git//autotest.git
Patch Set: List failed tests in the exception message. Created 10 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | client/site_tests/graphics_TearTest/control » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/deps/glbench/src/teartest.cc
diff --git a/client/deps/glbench/src/teartest.cc b/client/deps/glbench/src/teartest.cc
index 8b3c3973dde9adff608e592d26f41da16898dabc..b8e4677e763dbe6a093f3a96c8200164fcdfef0b 100644
--- a/client/deps/glbench/src/teartest.cc
+++ b/client/deps/glbench/src/teartest.cc
@@ -10,6 +10,7 @@
#include <time.h>
#include "base/logging.h"
+#include "base/string_util.h"
#include "main.h"
#include "utils.h"
@@ -17,11 +18,16 @@
#include "teartest.h"
-typedef std::map<const char*, Test*> TestMap;
+typedef std::map<std::string, Test*> TestMap;
DEFINE_int32(refresh, 0,
- "If 1 or more, target refresh rate; otherwise enable vsync");
+ "If 1 or more, target refresh rate; otherwise enable vsync.");
+
+DEFINE_string(tests, "uniform,teximage2d,pixmap_to_texture",
+ "Comma-separated list of tests to run.");
+
+DEFINE_int32(seconds_to_run, 5, "Seconds to run a test case for.");
GLuint GenerateAndBindTexture() {
GLuint name = ~0;
@@ -206,13 +212,23 @@ int main(int argc, char* argv[]) {
SwapInterval(sleep_duration ? 0 : 1);
- for (TestMap::iterator it = test_map.begin(); it != test_map.end(); it++) {
- Test* t = it->second;
- if (!t->Start())
+ std::vector<std::string> tests;
+ SplitString(FLAGS_tests, ',', &tests);
+
+ for (std::vector<std::string>::iterator it = tests.begin();
+ it != tests.end();
+ it++)
+ {
+ Test* t = test_map[*it];
+ if (!t || !t->Start())
continue;
Bool got_event = False;
- for (int x = 0; !got_event; x = (x + 4) % (2 * g_width)) {
+ uint64_t wait_until = GetUTime() + 1000000ULL * FLAGS_seconds_to_run;
+ for (int x = 0;
+ !got_event && GetUTime() < wait_until;
+ x = (x + 4) % (2 * g_width))
+ {
const int shift = x < g_width ? x : 2 * g_width - x;
t->Loop(shift);
« no previous file with comments | « no previous file | client/site_tests/graphics_TearTest/control » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698