diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2012-11-14 22:32:13 -0800 |
---|---|---|
committer | Kenneth Graunke <kenneth@whitecape.org> | 2013-01-03 13:40:41 -0800 |
commit | ca19fd2ce4b102cec56e6c955f913fb810d4b21d (patch) | |
tree | b6fb107963f1d93ef02f79156f3ac6b53ea05378 | |
parent | 9a4bc09db00dde770a648a9fccfc249e465bc262 (diff) |
glean: Remove Options::mode.
Now that result comparison is gone, there's no real need to store an
enum here...except for --listtests, it's always run. Simplify.
-rw-r--r-- | tests/glean/main.cpp | 24 | ||||
-rw-r--r-- | tests/glean/options.cpp | 1 | ||||
-rw-r--r-- | tests/glean/options.h | 4 |
3 files changed, 8 insertions, 21 deletions
diff --git a/tests/glean/main.cpp b/tests/glean/main.cpp index 91d14190..8084d314 100644 --- a/tests/glean/main.cpp +++ b/tests/glean/main.cpp @@ -68,7 +68,8 @@ main(int argc, char* argv[]) { allTestNames.push_back(t->name); sort(allTestNames.begin(), allTestNames.end()); o.selectedTests = allTestNames; - o.mode = Options::run; + + bool listTestsMode = false; for (int i = 1; i < argc; ++i) { if (!strcmp(argv[i], "--help")) { @@ -90,7 +91,7 @@ main(int argc, char* argv[]) { ++i; selectTests(o, allTestNames, argc, argv, i); } else if (!strcmp(argv[i], "--listtests")) { - o.mode = Options::listtests; + listTestsMode = true; # if defined(__X11__) } else if (!strcmp(argv[i], "-display") || !strcmp(argv[i], "--display")) { @@ -102,7 +103,7 @@ main(int argc, char* argv[]) { } } - if (o.mode == Options::listtests) { + if (listTestsMode) { listTests(Test::testList, o.verbosity); exit(0); } @@ -118,19 +119,10 @@ main(int argc, char* argv[]) { // results. try { Environment e(o); - switch (o.mode) { - case Options::run: - { - for (Test* t = Test::testList; t; t = t->nextTest) - if (binary_search(o.selectedTests.begin(), - o.selectedTests.end(), t->name)) - t->run(e); - break; - } - default: - cerr << "Bad run mode in main()\n"; - break; - } + for (Test* t = Test::testList; t; t = t->nextTest) + if (binary_search(o.selectedTests.begin(), + o.selectedTests.end(), t->name)) + t->run(e); } #if defined(__X11__) catch (WindowSystem::CantOpenDisplay) { diff --git a/tests/glean/options.cpp b/tests/glean/options.cpp index 9c393889..d77fbc59 100644 --- a/tests/glean/options.cpp +++ b/tests/glean/options.cpp @@ -41,7 +41,6 @@ namespace GLEAN { Options::Options() { - mode = notSet; verbosity = 0; visFilter = "1"; maxVisuals = ~0U; diff --git a/tests/glean/options.h b/tests/glean/options.h index 43321771..26fac814 100644 --- a/tests/glean/options.h +++ b/tests/glean/options.h @@ -57,10 +57,6 @@ namespace GLEAN { class Options { public: - typedef enum {notSet, run, listtests} RunMode; - RunMode mode; // Indicates whether we're generating - // results, or comparing two previous runs. - int verbosity; // Verbosity level. 0 == concise; larger // values imply more verbose output. |