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

Unified Diff: tests/skia_test.cpp

Issue 12521016: Add --resourcePath flag to the test program. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 7 years, 9 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 | « tests/Test.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/skia_test.cpp
diff --git a/tests/skia_test.cpp b/tests/skia_test.cpp
index 5d4af4cfac6ecc4d5e26f01fc08404ff5ef8dd99..9a632172d204eb65d0ff7c67fd0f9328d2f1cd43 100644
--- a/tests/skia_test.cpp
+++ b/tests/skia_test.cpp
@@ -99,12 +99,18 @@ static const char* make_canonical_dir_path(const char* path, SkString* storage)
return path;
}
-static const char* gTmpDir;
+static SkString gTmpDir;
-const char* Test::GetTmpDir() {
+const SkString& Test::GetTmpDir() {
return gTmpDir;
}
+static SkString gResourcePath;
+
+const SkString& Test::GetResourcePath() {
+ return gResourcePath;
+}
+
int tool_main(int argc, char** argv);
int tool_main(int argc, char** argv) {
#if SK_ENABLE_INST_COUNT
@@ -127,24 +133,30 @@ int tool_main(int argc, char** argv) {
} else if (0 == strcmp(*argv, "--tmpDir")) {
++argv;
if (argv < stop && **argv) {
- gTmpDir = *argv;
+ make_canonical_dir_path(*argv, &gTmpDir);
} else {
SkDebugf("no following argument to --tmpDir\n");
return -1;
}
+ } else if ((0 == strcmp(*argv, "--resourcePath")) ||
+ (0 == strcmp(*argv, "-i"))) {
+ argv++;
+ if (argv < stop && **argv) {
+ make_canonical_dir_path(*argv, &gResourcePath);
+ }
}
}
- SkString tmpDirStorage;
- gTmpDir = make_canonical_dir_path(gTmpDir, &tmpDirStorage);
-
{
SkString header("Skia UnitTests:");
if (matchStr) {
header.appendf(" --match %s", matchStr);
}
- if (gTmpDir) {
- header.appendf(" --tmpDir %s", gTmpDir);
+ if (!gTmpDir.isEmpty()) {
+ header.appendf(" --tmpDir %s", gTmpDir.c_str());
+ }
+ if (!gResourcePath.isEmpty()) {
+ header.appendf(" --resourcePath %s", gResourcePath.c_str());
}
#ifdef SK_DEBUG
header.append(" SK_DEBUG");
« no previous file with comments | « tests/Test.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698