Chromium Code Reviews| Index: gm/gmmain.cpp |
| =================================================================== |
| --- gm/gmmain.cpp (revision 8839) |
| +++ gm/gmmain.cpp (working copy) |
| @@ -38,6 +38,11 @@ |
| #include "SkTileGridPicture.h" |
| #include "SamplePipeControllers.h" |
| +#define EPOGER_TEST |
| +#ifdef EPOGER_TEST |
| +#include "SkTime.h" |
| +#endif |
| + |
| #ifdef SK_BUILD_FOR_WIN |
| // json includes xlocale which generates warning 4530 because we're compiling without |
| // exceptions; see https://code.google.com/p/skia/issues/detail?id=1067 |
| @@ -1447,11 +1452,15 @@ |
| SkBitmap comparisonBitmap; |
| const char* writePath; |
| +#ifdef EPOGER_TEST |
| + writePath = NULL; |
| +#else |
| if (FLAGS_writePath.count() == 1) { |
| writePath = FLAGS_writePath[0]; |
| } else { |
| writePath = NULL; |
| } |
| +#endif |
| if (errorsForThisConfig.isEmpty()) { |
| errorsForThisConfig.add(gmmain.test_drawing(gm,config, writePath, gpuTarget, |
| &comparisonBitmap)); |
| @@ -1515,6 +1524,8 @@ |
| } |
| } |
| +#ifdef EPOGER_TEST |
| +#else |
| if ((1 == FLAGS_writePicturePath.count()) && |
| !(gmFlags & GM::kSkipPicture_Flag)) { |
| const char* pictureSuffix = "skp"; |
| @@ -1523,6 +1534,7 @@ |
| SkFILEWStream stream(path.c_str()); |
| pict->serialize(&stream); |
| } |
| +#endif |
| if (FLAGS_rtree) { |
| const char renderModeDescriptor[] = "-rtree"; |
| @@ -1632,6 +1644,10 @@ |
| gPrintInstCount = true; |
| #endif |
| +#ifdef EPOGER_TEST |
| + SkMSec timeStart = SkTime::GetMSecs(); |
| +#endif |
| + |
| SkGraphics::Init(); |
| // we don't need to see this during a run |
| gSkSuppressFontCachePurgeSpew = true; |
| @@ -1799,10 +1815,18 @@ |
| } |
| if (FLAGS_verbose) { |
| if (FLAGS_writePath.count() == 1) { |
| +#ifdef EPOGER_TEST |
| + gm_fprintf(stdout, "EPOGER_TEST: NOT writing to %s\n", FLAGS_writePath[0]); |
| +#else |
| gm_fprintf(stdout, "writing to %s\n", FLAGS_writePath[0]); |
| +#endif |
| } |
| if (FLAGS_writePicturePath.count() == 1) { |
| +#ifdef EPOGER_TEST |
| + gm_fprintf(stdout, "EPOGER_TEST: NOT writing pictures to %s\n", FLAGS_writePicturePath[0]); |
| +#else |
| gm_fprintf(stdout, "writing pictures to %s\n", FLAGS_writePicturePath[0]); |
| +#endif |
| } |
| if (FLAGS_resourcePath.count() == 1) { |
| gm_fprintf(stdout, "reading resources from %s\n", FLAGS_resourcePath[0]); |
| @@ -1820,6 +1844,8 @@ |
| int gmIndex = -1; |
| SkString moduloStr; |
| +#ifdef EPOGER_TEST |
| +#else |
| // If we will be writing out files, prepare subdirectories. |
| if (FLAGS_writePath.count() == 1) { |
| if (!sk_mkdir(FLAGS_writePath[0])) { |
| @@ -1837,6 +1863,7 @@ |
| } |
| } |
| } |
| +#endif |
| if (FLAGS_pdfJpegQuality < -1 || FLAGS_pdfJpegQuality > 100) { |
| gm_fprintf(stderr, "%s\n", "pdfJpegQuality must be in [-1 .. 100] range."); |
| @@ -1884,6 +1911,10 @@ |
| } |
| int expectedNumberOfTests = gmsRun * (configs.count() + modes.count()); |
| +#ifdef EPOGER_TEST |
| + SkMSec timeBeforeSummaryOutput = SkTime::GetMSecs(); |
| +#endif |
| + |
| // Output summary to stdout. |
| if (FLAGS_verbose) { |
| gm_fprintf(stdout, "Ran %d GMs\n", gmsRun); |
| @@ -1905,6 +1936,23 @@ |
| } |
| #endif |
| +#ifdef EPOGER_TEST |
| + Json::Value actualResults; |
| + actualResults[kJsonKey_ActualResults_Failed] = |
| + gmmain.fJsonActualResults_Failed; |
| + actualResults[kJsonKey_ActualResults_FailureIgnored] = |
| + gmmain.fJsonActualResults_FailureIgnored; |
| + actualResults[kJsonKey_ActualResults_NoComparison] = |
| + gmmain.fJsonActualResults_NoComparison; |
| + actualResults[kJsonKey_ActualResults_Succeeded] = |
| + gmmain.fJsonActualResults_Succeeded; |
| + Json::Value root; |
| + root[kJsonKey_ActualResults] = actualResults; |
| + root[kJsonKey_ExpectedResults] = gmmain.fJsonExpectedResults; |
| + std::string jsonStdString = root.toStyledString(); |
| + printf("%s\n", jsonStdString.c_str()); |
| +#endif |
| + |
| if (FLAGS_writeJsonSummaryPath.count() == 1) { |
| Json::Value actualResults; |
| actualResults[kJsonKey_ActualResults_Failed] = |
| @@ -1942,6 +1990,17 @@ |
| #endif |
| SkGraphics::Term(); |
| +#ifdef EPOGER_TEST |
| + SkMSec timeEnd = SkTime::GetMSecs(); |
| + printf("EPOGER_TEST timings with %s algorithm: %d msecs before summary output, %d msecs total\n", |
|
epoger
2013/04/24 17:36:58
patchset 3 only adds a report of which hashing alg
|
| +#ifdef BITMAPHASHER_USES_TRUNCATED_MD5 |
| + "MD5", |
| +#else |
| + "CityHash", |
| +#endif |
| + (timeBeforeSummaryOutput - timeStart), (timeEnd - timeStart)); |
| +#endif |
| + |
| return (reportError) ? -1 : 0; |
| } |