static void writeTestName(const char* nameSuffix, SkMemoryWStream& outFile) { outFile.writeText(testName); outFile.writeDecAsText(testNumber); ++testNumber; if (nameSuffix) { outFile.writeText(nameSuffix); } }
static void outputToStream(const char* pathStr, const char* pathPrefix, const char* nameSuffix, const char* testFunction, bool twoPaths, SkMemoryWStream& outFile) { #if 0 outFile.writeText("\n<div id=\""); writeTestName(nameSuffix, outFile); outFile.writeText("\">\n"); if (pathPrefix) { outFile.writeText(pathPrefix); } outFile.writeText(pathStr); outFile.writeText("</div>\n\n"); outFile.writeText(marker); outFile.writeText(" "); writeTestName(nameSuffix, outFile); outFile.writeText(",\n\n\n"); #endif outFile.writeText("static void "); writeTestName(nameSuffix, outFile); outFile.writeText("(skiatest::Reporter* reporter) {\n SkPath path"); if (twoPaths) { outFile.writeText(", pathB"); } outFile.writeText(";\n"); if (pathPrefix) { outFile.writeText(pathPrefix); } outFile.writeText(pathStr); outFile.writeText(" "); outFile.writeText(testFunction); outFile.writeText("\n}\n\n"); #if 0 outFile.writeText("static void (*firstTest)() = "); writeTestName(nameSuffix, outFile); outFile.writeText(";\n\n"); outFile.writeText("static struct {\n"); outFile.writeText(" void (*fun)();\n"); outFile.writeText(" const char* str;\n"); outFile.writeText("} tests[] = {\n"); outFile.writeText(" TEST("); writeTestName(nameSuffix, outFile); outFile.writeText("),\n"); #endif outFile.flush(); }