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

Unified Diff: tests/PathOpsSkpClipTest.cpp

Issue 18058007: path ops work in progress (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: try try again Created 7 years, 5 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/PathOpsSimplifyTest.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsSkpClipTest.cpp
diff --git a/tests/PathOpsSkpClipTest.cpp b/tests/PathOpsSkpClipTest.cpp
index e06a4b497e78428cad294867ce0c5d6f8cb30ab3..f46ad976d528f6d82e75c14169ce97a27df3ba29 100644
--- a/tests/PathOpsSkpClipTest.cpp
+++ b/tests/PathOpsSkpClipTest.cpp
@@ -10,20 +10,48 @@
#include "SkPicture.h"
#include "SkString.h"
-static const char pictDir[] = "D:\\skp";
-static const char outSkpClipDir[] = "D:\\skpClip";
-static const char outOldClipDir[] = "D:\\oldClip";
+#ifdef SK_BUILD_FOR_WIN
+#define PATH_SLASH "\\"
+#define IN_DIR "D:" PATH_SLASH "skp"
+#define OUT_DIR "D:" PATH_SLASH
+#else
+#define PATH_SLASH "/"
+#define IN_DIR "/Volumes/Untitled" PATH_SLASH
+#define OUT_DIR PATH_SLASH
+#endif
+
+static const char pictDir[] = IN_DIR ;
+static const char outSkpClipDir[] = OUT_DIR "skpClip";
+static const char outOldClipDir[] = OUT_DIR "oldClip";
static void make_filepath(SkString* path, const char* dir, const SkString& name) {
size_t len = strlen(dir);
path->set(dir);
- if (len > 0 && dir[len - 1] != '/') {
- path->append("\\");
+ if (len > 0 && dir[len - 1] != PATH_SLASH[0]) {
+ path->append(PATH_SLASH);
}
path->append(name);
}
static void testOne(const SkString& filename) {
+#if DEBUG_SHOW_TEST_NAME
+ SkString testName(filename);
+ const char http[] = "http";
+ if (testName.startsWith(http)) {
+ testName.remove(0, sizeof(http) - 1);
+ }
+ while (testName.startsWith("_")) {
+ testName.remove(0, 1);
+ }
+ const char dotSkp[] = ".skp";
+ if (testName.endsWith(dotSkp)) {
+ size_t len = testName.size();
+ testName.remove(len - (sizeof(dotSkp) - 1), sizeof(dotSkp) - 1);
+ }
+ testName.prepend("skp");
+ testName.append("1");
+ strncpy(DEBUG_FILENAME_STRING, testName.c_str(), DEBUG_FILENAME_STRING_LENGTH);
+#endif
SkString path;
make_filepath(&path, pictDir, filename);
SkFILEStream stream(path.c_str());
@@ -60,11 +88,16 @@ static void testOne(const SkString& filename) {
SkDELETE(pic);
}
+const char skipBefore[] = "http___health_com.skp";
+
static void PathOpsSkpClipTest(skiatest::Reporter* reporter) {
SkOSFile::Iter iter(pictDir, "skp");
SkString filename;
int testCount = 0;
while (iter.next(&filename)) {
+ if (strcmp(filename.c_str(), skipBefore) < 0) {
+ continue;
+ }
testOne(filename);
if (reporter->verbose()) {
SkDebugf(".");
@@ -95,6 +128,9 @@ static void PathOpsSkpClipThreadedTest(skiatest::Reporter* reporter) {
SkOSFile::Iter iter(pictDir, "skp");
SkString filename;
while (iter.next(&filename)) {
+ if (strcmp(filename.c_str(), skipBefore) < 0) {
+ continue;
+ }
*testRunner.fRunnables.append() = SkNEW_ARGS(PathOpsThreadedRunnable,
(&testSkpClipMain, filename.c_str(), &testRunner));
reporter->bumpTestCount();
@@ -103,7 +139,7 @@ static void PathOpsSkpClipThreadedTest(skiatest::Reporter* reporter) {
}
static void PathOpsSkpClipTestOne(skiatest::Reporter* reporter) {
- SkString filename("http___9to5employment_com.skp");
+ SkString filename(skipBefore);
testOne(filename);
}
« no previous file with comments | « tests/PathOpsSimplifyTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698