From c61c3c310185f6ffaefce194a079159423945191 Mon Sep 17 00:00:00 2001 From: "commit-bot@chromium.org" Date: Fri, 1 Mar 2013 15:32:34 +0000 Subject: [PATCH] gm self-test: use a pathologically simple test case instead of dashing2 BUG=https://code.google.com/p/skia/issues/detail?id=677 Review URL: https://chromiumcodereview.appspot.com/12381038 git-svn-id: http://skia.googlecode.com/svn/trunk@7922 2bbb7eff-a529-9590-31e7-b0007b416f81 --- gm/selftest.cpp | 48 ++++++++++++++++++++ .../output-expected/json-summary.txt | 8 ++-- .../aaclip-write/output-expected/json-summary.txt | 4 +- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 16 +++---- .../output-expected/stdout | 2 +- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 16 +++---- .../output-expected/stdout | 2 +- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 12 ++--- .../output-expected/stdout | 6 +-- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 16 +++---- .../output-expected/stdout | 2 +- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 16 +++---- .../output-expected/stdout | 2 +- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 16 +++---- .../output-expected/stdout | 2 +- .../output-expected/command_line | 2 +- .../output-expected/json-summary.txt | 16 +++---- .../output-expected/stdout | 2 +- .../no-readpath/output-expected/command_line | 2 +- .../no-readpath/output-expected/json-summary.txt | 8 ++-- .../outputs/no-readpath/output-expected/stdout | 2 +- gm/tests/run.sh | 53 +++++++++------------- gyp/gmslides.gypi | 1 + 29 files changed, 153 insertions(+), 113 deletions(-) create mode 100644 gm/selftest.cpp diff --git a/gm/selftest.cpp b/gm/selftest.cpp new file mode 100644 index 0000000..840dac2 --- /dev/null +++ b/gm/selftest.cpp @@ -0,0 +1,48 @@ +/* + * Copyright 2013 Google Inc. + * + * Use of this source code is governed by a BSD-style license that can be + * found in the LICENSE file. + */ + +/** + * Pathologically simple drawing tests, designed to generate consistent + * output images across platforms for gm/tests/run.sh + */ + +#include "gm.h" +#include "SkCanvas.h" +#include "SkPaint.h" + +class SelfTestGM : public skiagm::GM { +public: + SelfTestGM(const char name[], SkColor color) : fName(name), fColor(color) {} + const static int kWidth = 300; + const static int kHeight = 200; + +protected: + SkString onShortName() { + return fName; + } + + SkISize onISize() { return skiagm::make_isize(kWidth, kHeight); } + + virtual void onDraw(SkCanvas* canvas) { + SkPaint paint; + paint.setStyle(SkPaint::kFill_Style); + paint.setColor(fColor); + canvas->drawRectCoords(0, 0, SkIntToScalar(kWidth), SkIntToScalar(kHeight), paint); + } + +private: + const SkString fName; + const SkColor fColor; +}; + +////////////////////////////////////////////////////////////////////////////// + +static skiagm::GM* F1(void*) { return new SelfTestGM("selftest1", SK_ColorGREEN); } +static skiagm::GM* F2(void*) { return new SelfTestGM("selftest2", SK_ColorBLUE); } + +static skiagm::GMRegistry gR1(F1); +static skiagm::GMRegistry gR2(F2); diff --git a/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt b/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt index 83d2e77..6fea678 100644 --- a/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt +++ b/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt @@ -5,20 +5,20 @@ "no-comparison" : null, "succeeded" : { "simpleaaclip_path_565" : { - "checksum" : FAKE + "checksum" : 8375148850964385904 }, "simpleaaclip_path_8888" : { - "checksum" : FAKE + "checksum" : 4719056555285640269 } } }, "expected-results" : { "simpleaaclip_path_565" : { - "checksums" : [ FAKE ], + "checksums" : [ 8375148850964385904 ], "ignore-failure" : false }, "simpleaaclip_path_8888" : { - "checksums" : [ FAKE ], + "checksums" : [ 4719056555285640269 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt b/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt index 832f828..0c3808a 100644 --- a/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt +++ b/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt @@ -4,10 +4,10 @@ "failure-ignored" : null, "no-comparison" : { "simpleaaclip_path_565" : { - "checksum" : FAKE + "checksum" : 8375148850964385904 }, "simpleaaclip_path_8888" : { - "checksum" : FAKE + "checksum" : 4719056555285640269 } }, "succeeded" : null diff --git a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/command_line b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/command_line index 494eb85..9c664aa 100644 --- a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/command_line +++ b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/images/different-pixels --writeJsonSummary gm/tests/outputs/compared-against-different-pixels-images/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/images/different-pixels --writeJsonSummary gm/tests/outputs/compared-against-different-pixels-images/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt index 37709e1..2fca415 100644 --- a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt @@ -1,11 +1,11 @@ { "actual-results" : { "failed" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } }, "failure-ignored" : null, @@ -13,12 +13,12 @@ "succeeded" : null }, "expected-results" : { - "565/dashing2" : { - "checksums" : [ FAKE ], + "565/selftest1" : { + "checksums" : [ 8143889227369140487 ], "ignore-failure" : false }, - "8888/dashing2" : { - "checksums" : [ FAKE ], + "8888/selftest1" : { + "checksums" : [ 8143889227369140487 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/stdout b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/stdout index a001fc6..d4b37ea 100644 --- a/gm/tests/outputs/compared-against-different-pixels-images/output-expected/stdout +++ b/gm/tests/outputs/compared-against-different-pixels-images/output-expected/stdout @@ -1,3 +1,3 @@ reading from gm/tests/inputs/images/different-pixels -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 0 passed, 1 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line index 1226cf2..8e75446 100644 --- a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/json/different-pixels.json --writeJsonSummary gm/tests/outputs/compared-against-different-pixels-json/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/json/different-pixels.json --writeJsonSummary gm/tests/outputs/compared-against-different-pixels-json/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt index 37709e1..2fca415 100644 --- a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt @@ -1,11 +1,11 @@ { "actual-results" : { "failed" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } }, "failure-ignored" : null, @@ -13,12 +13,12 @@ "succeeded" : null }, "expected-results" : { - "565/dashing2" : { - "checksums" : [ FAKE ], + "565/selftest1" : { + "checksums" : [ 8143889227369140487 ], "ignore-failure" : false }, - "8888/dashing2" : { - "checksums" : [ FAKE ], + "8888/selftest1" : { + "checksums" : [ 8143889227369140487 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout index 9194b40..fc017a5 100644 --- a/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout +++ b/gm/tests/outputs/compared-against-different-pixels-json/output-expected/stdout @@ -1,3 +1,3 @@ reading expectations from JSON summary file gm/tests/inputs/json/different-pixels.json -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 0 passed, 1 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-empty-dir/output-expected/command_line b/gm/tests/outputs/compared-against-empty-dir/output-expected/command_line index 637b397..a58c364 100644 --- a/gm/tests/outputs/compared-against-empty-dir/output-expected/command_line +++ b/gm/tests/outputs/compared-against-empty-dir/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/images/empty-dir --writeJsonSummary gm/tests/outputs/compared-against-empty-dir/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/images/empty-dir --writeJsonSummary gm/tests/outputs/compared-against-empty-dir/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt index 6ffaf35..fdc6ab3 100644 --- a/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt @@ -3,21 +3,21 @@ "failed" : null, "failure-ignored" : null, "no-comparison" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } }, "succeeded" : null }, "expected-results" : { - "565/dashing2" : { + "565/selftest1" : { "checksums" : null, "ignore-failure" : false }, - "8888/dashing2" : { + "8888/selftest1" : { "checksums" : null, "ignore-failure" : false } diff --git a/gm/tests/outputs/compared-against-empty-dir/output-expected/stdout b/gm/tests/outputs/compared-against-empty-dir/output-expected/stdout index e5e2f39..faf12bf 100644 --- a/gm/tests/outputs/compared-against-empty-dir/output-expected/stdout +++ b/gm/tests/outputs/compared-against-empty-dir/output-expected/stdout @@ -1,5 +1,5 @@ reading from gm/tests/inputs/images/empty-dir -drawing... dashing2 [640 480] -FAILED to read gm/tests/inputs/images/empty-dir/8888/dashing2.png -FAILED to read gm/tests/inputs/images/empty-dir/565/dashing2.png +drawing... selftest1 [300 200] +FAILED to read gm/tests/inputs/images/empty-dir/8888/selftest1.png +FAILED to read gm/tests/inputs/images/empty-dir/565/selftest1.png Ran 1 tests: 1 passed, 0 failed, 1 missing reference images diff --git a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/command_line b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/command_line index 382655a..849d485 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/command_line +++ b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/images/identical-bytes --writeJsonSummary gm/tests/outputs/compared-against-identical-bytes-images/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/images/identical-bytes --writeJsonSummary gm/tests/outputs/compared-against-identical-bytes-images/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt index bed3b2d..1fcd8f0 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt @@ -4,21 +4,21 @@ "failure-ignored" : null, "no-comparison" : null, "succeeded" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } } }, "expected-results" : { - "565/dashing2" : { - "checksums" : [ FAKE ], + "565/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false }, - "8888/dashing2" : { - "checksums" : [ FAKE ], + "8888/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/stdout b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/stdout index 8055992..73148ba 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/stdout +++ b/gm/tests/outputs/compared-against-identical-bytes-images/output-expected/stdout @@ -1,3 +1,3 @@ reading from gm/tests/inputs/images/identical-bytes -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 1 passed, 0 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line index e8fb0b9..6b82f39 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/json/identical-bytes.json --writeJsonSummary gm/tests/outputs/compared-against-identical-bytes-json/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/json/identical-bytes.json --writeJsonSummary gm/tests/outputs/compared-against-identical-bytes-json/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt index bed3b2d..1fcd8f0 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt @@ -4,21 +4,21 @@ "failure-ignored" : null, "no-comparison" : null, "succeeded" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } } }, "expected-results" : { - "565/dashing2" : { - "checksums" : [ FAKE ], + "565/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false }, - "8888/dashing2" : { - "checksums" : [ FAKE ], + "8888/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout index afa854c..82c5cac 100644 --- a/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout +++ b/gm/tests/outputs/compared-against-identical-bytes-json/output-expected/stdout @@ -1,3 +1,3 @@ reading expectations from JSON summary file gm/tests/inputs/json/identical-bytes.json -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 1 passed, 0 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/command_line b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/command_line index 0b0ee91..c282d00 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/command_line +++ b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/images/identical-pixels --writeJsonSummary gm/tests/outputs/compared-against-identical-pixels-images/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/images/identical-pixels --writeJsonSummary gm/tests/outputs/compared-against-identical-pixels-images/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt index bed3b2d..1fcd8f0 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt @@ -4,21 +4,21 @@ "failure-ignored" : null, "no-comparison" : null, "succeeded" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } } }, "expected-results" : { - "565/dashing2" : { - "checksums" : [ FAKE ], + "565/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false }, - "8888/dashing2" : { - "checksums" : [ FAKE ], + "8888/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/stdout b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/stdout index 2f8fa86..958cd15 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/stdout +++ b/gm/tests/outputs/compared-against-identical-pixels-images/output-expected/stdout @@ -1,3 +1,3 @@ reading from gm/tests/inputs/images/identical-pixels -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 1 passed, 0 failed, 0 missing reference images diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line index a596064..6161298 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 -r gm/tests/inputs/json/identical-pixels.json --writeJsonSummary gm/tests/outputs/compared-against-identical-pixels-json/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 -r gm/tests/inputs/json/identical-pixels.json --writeJsonSummary gm/tests/outputs/compared-against-identical-pixels-json/output-actual/json-summary.txt diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt index bed3b2d..1fcd8f0 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt @@ -4,21 +4,21 @@ "failure-ignored" : null, "no-comparison" : null, "succeeded" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } } }, "expected-results" : { - "565/dashing2" : { - "checksums" : [ FAKE ], + "565/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false }, - "8888/dashing2" : { - "checksums" : [ FAKE ], + "8888/selftest1" : { + "checksums" : [ 9948284449770991531 ], "ignore-failure" : false } } diff --git a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout index 3b2671a..302f765 100644 --- a/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout +++ b/gm/tests/outputs/compared-against-identical-pixels-json/output-expected/stdout @@ -1,3 +1,3 @@ reading expectations from JSON summary file gm/tests/inputs/json/identical-pixels.json -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 1 passed, 0 failed, 0 missing reference images diff --git a/gm/tests/outputs/no-readpath/output-expected/command_line b/gm/tests/outputs/no-readpath/output-expected/command_line index 1609465..9339f80 100644 --- a/gm/tests/outputs/no-readpath/output-expected/command_line +++ b/gm/tests/outputs/no-readpath/output-expected/command_line @@ -1 +1 @@ -out/Debug/gm --hierarchy --match dashing2 --config 8888 --config 565 --writeJsonSummary gm/tests/outputs/no-readpath/output-actual/json-summary.txt +out/Debug/gm --hierarchy --match selftest1 --config 8888 --config 565 --writeJsonSummary gm/tests/outputs/no-readpath/output-actual/json-summary.txt diff --git a/gm/tests/outputs/no-readpath/output-expected/json-summary.txt b/gm/tests/outputs/no-readpath/output-expected/json-summary.txt index 81db3a2..dbe8a48 100644 --- a/gm/tests/outputs/no-readpath/output-expected/json-summary.txt +++ b/gm/tests/outputs/no-readpath/output-expected/json-summary.txt @@ -3,11 +3,11 @@ "failed" : null, "failure-ignored" : null, "no-comparison" : { - "565/dashing2" : { - "checksum" : FAKE + "565/selftest1" : { + "checksum" : 9948284449770991531 }, - "8888/dashing2" : { - "checksum" : FAKE + "8888/selftest1" : { + "checksum" : 9948284449770991531 } }, "succeeded" : null diff --git a/gm/tests/outputs/no-readpath/output-expected/stdout b/gm/tests/outputs/no-readpath/output-expected/stdout index bcd0608..78a211f 100644 --- a/gm/tests/outputs/no-readpath/output-expected/stdout +++ b/gm/tests/outputs/no-readpath/output-expected/stdout @@ -1,2 +1,2 @@ -drawing... dashing2 [640 480] +drawing... selftest1 [300 200] Ran 1 tests: 1 passed, 0 failed, 1 missing reference images diff --git a/gm/tests/run.sh b/gm/tests/run.sh index a90db38..f539598 100755 --- a/gm/tests/run.sh +++ b/gm/tests/run.sh @@ -5,9 +5,8 @@ # These tests are run by the Skia_PerCommit_House_Keeping bot at every commit, # so make sure that they still pass when you make changes to gm! # -# TODO: currently, this only passes on Linux (which is the platform that -# the housekeeper bot runs on, e.g. -# http://70.32.156.51:10117/builders/Skia_PerCommit_House_Keeping/builds/1417/steps/RunGmSelfTests/logs/stdio ) +# TODO: because this is written as a shell script (instead of, say, Python) +# it only runs on Linux and Mac. # See https://code.google.com/p/skia/issues/detail?id=677 # ('make tools/tests/run.sh work cross-platform') # Ideally, these tests should pass on all development platforms... @@ -74,14 +73,6 @@ function gm_test { >$ACTUAL_OUTPUT_DIR/stdout-tmp mv $ACTUAL_OUTPUT_DIR/stdout-tmp $ACTUAL_OUTPUT_DIR/stdout - # Replace particular checksums in json summary with a placeholder, so - # we don't need to rebaseline these json files when our drawing routines - # change. - sed -e 's/"checksum" : [0-9]*/"checksum" : FAKE/g' \ - --in-place $JSON_SUMMARY_FILE - sed -e 's/"checksums" : \[ [0-9]* \]/"checksums" : [ FAKE ]/g' \ - --in-place $JSON_SUMMARY_FILE - compare_directories $EXPECTED_OUTPUT_DIR $ACTUAL_OUTPUT_DIR } @@ -104,32 +95,32 @@ function create_inputs_dir { mkdir -p $IMAGES_DIR/identical-bytes # Run GM to write out the images actually generated. - $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ + $GM_BINARY --hierarchy --match selftest1 $CONFIGS \ -w $IMAGES_DIR/identical-bytes # Run GM again to read in those images and write them out as a JSON summary. - $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ + $GM_BINARY --hierarchy --match selftest1 $CONFIGS \ -r $IMAGES_DIR/identical-bytes \ --writeJsonSummary $JSON_DIR/identical-bytes.json mkdir -p $IMAGES_DIR/identical-pixels - $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ + $GM_BINARY --hierarchy --match selftest1 $CONFIGS \ -w $IMAGES_DIR/identical-pixels echo "more bytes that do not change the image pixels" \ - >> $IMAGES_DIR/identical-pixels/8888/dashing2.png + >> $IMAGES_DIR/identical-pixels/8888/selftest1.png echo "more bytes that do not change the image pixels" \ - >> $IMAGES_DIR/identical-pixels/565/dashing2.png - $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ + >> $IMAGES_DIR/identical-pixels/565/selftest1.png + $GM_BINARY --hierarchy --match selftest1 $CONFIGS \ -r $IMAGES_DIR/identical-pixels \ --writeJsonSummary $JSON_DIR/identical-pixels.json mkdir -p $IMAGES_DIR/different-pixels - $GM_BINARY --hierarchy --match dashing3 $CONFIGS \ + $GM_BINARY --hierarchy --match selftest2 $CONFIGS \ -w $IMAGES_DIR/different-pixels - mv $IMAGES_DIR/different-pixels/8888/dashing3.png \ - $IMAGES_DIR/different-pixels/8888/dashing2.png - mv $IMAGES_DIR/different-pixels/565/dashing3.png \ - $IMAGES_DIR/different-pixels/565/dashing2.png - $GM_BINARY --hierarchy --match dashing2 $CONFIGS \ + mv $IMAGES_DIR/different-pixels/8888/selftest2.png \ + $IMAGES_DIR/different-pixels/8888/selftest1.png + mv $IMAGES_DIR/different-pixels/565/selftest2.png \ + $IMAGES_DIR/different-pixels/565/selftest1.png + $GM_BINARY --hierarchy --match selftest1 $CONFIGS \ -r $IMAGES_DIR/different-pixels \ --writeJsonSummary $JSON_DIR/different-pixels.json @@ -144,24 +135,24 @@ GM_TEMPFILES=$GM_TESTDIR/tempfiles create_inputs_dir $GM_INPUTS # Compare generated image against an input image file with identical bytes. -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/identical-bytes" "$GM_OUTPUTS/compared-against-identical-bytes-images" -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/identical-bytes.json" "$GM_OUTPUTS/compared-against-identical-bytes-json" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/identical-bytes" "$GM_OUTPUTS/compared-against-identical-bytes-images" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/identical-bytes.json" "$GM_OUTPUTS/compared-against-identical-bytes-json" # Compare generated image against an input image file with identical pixels but different PNG encoding. -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/identical-pixels" "$GM_OUTPUTS/compared-against-identical-pixels-images" -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/identical-pixels.json" "$GM_OUTPUTS/compared-against-identical-pixels-json" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/identical-pixels" "$GM_OUTPUTS/compared-against-identical-pixels-images" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/identical-pixels.json" "$GM_OUTPUTS/compared-against-identical-pixels-json" # Compare generated image against an input image file with different pixels. -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/different-pixels" "$GM_OUTPUTS/compared-against-different-pixels-images" -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OUTPUTS/compared-against-different-pixels-json" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/different-pixels" "$GM_OUTPUTS/compared-against-different-pixels-images" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/json/different-pixels.json" "$GM_OUTPUTS/compared-against-different-pixels-json" # Compare generated image against an empty "expected image" dir. -gm_test "--hierarchy --match dashing2 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/compared-against-empty-dir" +gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir" "$GM_OUTPUTS/compared-against-empty-dir" # If run without "-r", the JSON's "actual-results" section should contain # actual checksums marked as "failure-ignored", but the "expected-results" # section should be empty. -gm_test "--hierarchy --match dashing2 $CONFIGS" "$GM_OUTPUTS/no-readpath" +gm_test "--hierarchy --match selftest1 $CONFIGS" "$GM_OUTPUTS/no-readpath" # Run a test which generates partially transparent images, write out those # images, and read them back in. diff --git a/gyp/gmslides.gypi b/gyp/gmslides.gypi index 70a77d2..0b42eed 100644 --- a/gyp/gmslides.gypi +++ b/gyp/gmslides.gypi @@ -68,6 +68,7 @@ '../gm/rrects.cpp', '../gm/samplerstress.cpp', '../gm/shaderbounds.cpp', + '../gm/selftest.cpp', '../gm/shadertext.cpp', '../gm/shadertext2.cpp', '../gm/shadertext3.cpp', -- 2.7.4