Index: tests/skia_test.cpp |
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp |
index f4b67c9bc40f4df6d3821096e5ee587b89b2e997..c155cb6ad458d1bb9dfce3a338e71a9a43d8a4e2 100644 |
--- a/tests/skia_test.cpp |
+++ b/tests/skia_test.cpp |
@@ -8,7 +8,7 @@ |
#include "CrashHandler.h" |
#include "OverwriteLine.h" |
#include "Resources.h" |
-#include "SkCommandLineFlags.h" |
+#include "SkCommonFlags.h" |
#include "SkGraphics.h" |
#include "SkOSFile.h" |
#include "SkTArray.h" |
@@ -24,23 +24,7 @@ |
using namespace skiatest; |
-DEFINE_string2(match, m, NULL, "[~][^]substring[$] [...] of test name to run.\n" \ |
- "Multiple matches may be separated by spaces.\n" \ |
- "~ causes a matching test to always be skipped\n" \ |
- "^ requires the start of the test to match\n" \ |
- "$ requires the end of the test to match\n" \ |
- "^ and $ requires an exact match\n" \ |
- "If a test does not match any list entry,\n" \ |
- "it is skipped unless some list entry starts with ~"); |
DEFINE_bool2(extendedTest, x, false, "run extended tests for pathOps."); |
-DEFINE_bool2(leaks, l, false, "show leaked ref cnt'd objects."); |
-DEFINE_bool2(single, z, false, "run tests on a single thread internally."); |
-DEFINE_bool2(verbose, v, false, "enable verbose output from the test driver."); |
-DEFINE_bool2(veryVerbose, V, false, "tell individual tests to be verbose."); |
-DEFINE_bool(cpu, true, "whether or not to run CPU tests."); |
-DEFINE_bool(gpu, true, "whether or not to run GPU tests."); |
-DEFINE_int32(threads, SkThreadPool::kThreadPerCore, |
- "Run threadsafe tests on a threadpool with this many threads."); |
// need to explicitly declare this, or we get some weird infinite loop llist |
template TestRegistry* TestRegistry::gHead; |
@@ -131,11 +115,19 @@ static bool should_run(const char* testName, bool isGPUTest) { |
return true; |
} |
-int tool_main(int argc, char** argv); |
-int tool_main(int argc, char** argv) { |
+#if SK_BUILD_FOR_IOS |
+#define TOOL_MAIN test_main |
+#else |
+#define TOOL_MAIN tool_main |
+#endif |
+ |
+int TOOL_MAIN(int argc, char** argv); |
scroggo
2014/07/11 21:12:14
Is there any harm in always naming this test_main?
caryclark
2014/07/14 12:24:46
It's a bit conservative in case there was some fur
caryclark
2014/07/14 13:00:47
I checked with Derek and he now uses main() instea
|
+int TOOL_MAIN(int argc, char** argv) { |
SetupCrashHandler(); |
+#ifndef SK_BUILD_FOR_IOS |
SkCommandLineFlags::SetUsage(""); |
scroggo
2014/07/11 21:12:14
What if we moved this code into main, down below?
caryclark
2014/07/14 12:24:46
Same argument: if we want to support dynamic loadi
caryclark
2014/07/14 13:00:47
Code moved as Leon suggested. (done)
|
SkCommandLineFlags::Parse(argc, argv); |
+#endif |
#if SK_ENABLE_INST_COUNT |
if (FLAGS_leaks) { |
@@ -236,6 +228,6 @@ int tool_main(int argc, char** argv) { |
#if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) |
int main(int argc, char * const argv[]) { |
- return tool_main(argc, (char**) argv); |
+ return TOOL_MAIN(argc, (char**) argv); |
} |
#endif |