aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-02 19:56:18 +0000
committerGravatar epoger@google.com <epoger@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-03-02 19:56:18 +0000
commitb9ba1eadc839fb346a5bcf5f7a38b775e1069586 (patch)
tree7044b9a452837dc871e2dd80e16b23bcc0edcf9a
parent7ae918eec73865ad0c0c138680e9d2df9fc5ea82 (diff)
gm self-test: make all test cases exercise transparency
-rw-r--r--gm/selftest.cpp10
-rw-r--r--gm/tests/outputs/aaclip-readback/output-expected/command_line1
-rw-r--r--gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt25
-rw-r--r--gm/tests/outputs/aaclip-readback/output-expected/return_value1
-rw-r--r--gm/tests/outputs/aaclip-readback/output-expected/stdout3
-rw-r--r--gm/tests/outputs/aaclip-write/output-expected/command_line1
-rw-r--r--gm/tests/outputs/aaclip-write/output-expected/json-summary.txt16
-rw-r--r--gm/tests/outputs/aaclip-write/output-expected/return_value1
-rw-r--r--gm/tests/outputs/aaclip-write/output-expected/stdout3
-rw-r--r--gm/tests/outputs/compared-against-different-pixels-images/output-expected/json-summary.txt8
-rw-r--r--gm/tests/outputs/compared-against-different-pixels-json/output-expected/json-summary.txt8
-rw-r--r--gm/tests/outputs/compared-against-empty-dir/output-expected/json-summary.txt4
-rw-r--r--gm/tests/outputs/compared-against-identical-bytes-images/output-expected/json-summary.txt8
-rw-r--r--gm/tests/outputs/compared-against-identical-bytes-json/output-expected/json-summary.txt8
-rw-r--r--gm/tests/outputs/compared-against-identical-pixels-images/output-expected/json-summary.txt8
-rw-r--r--gm/tests/outputs/compared-against-identical-pixels-json/output-expected/json-summary.txt8
-rw-r--r--gm/tests/outputs/no-readpath/output-expected/json-summary.txt4
-rwxr-xr-xgm/tests/run.sh16
18 files changed, 36 insertions, 97 deletions
diff --git a/gm/selftest.cpp b/gm/selftest.cpp
index 840dac2e85..812d47512f 100644
--- a/gm/selftest.cpp
+++ b/gm/selftest.cpp
@@ -41,8 +41,14 @@ private:
//////////////////////////////////////////////////////////////////////////////
-static skiagm::GM* F1(void*) { return new SelfTestGM("selftest1", SK_ColorGREEN); }
-static skiagm::GM* F2(void*) { return new SelfTestGM("selftest2", SK_ColorBLUE); }
+// We use translucent colors to make sure we are properly handling cases like
+// those which caused https://code.google.com/p/skia/issues/detail?id=1079
+// ('gm generating spurious pixel_error messages as of r7258')
+static SkColor kTranslucentGreen = 0x7700EE00;
+static SkColor kTranslucentBlue = 0x770000DD;
+
+static skiagm::GM* F1(void*) { return new SelfTestGM("selftest1", kTranslucentGreen); }
+static skiagm::GM* F2(void*) { return new SelfTestGM("selftest2", kTranslucentBlue); }
static skiagm::GMRegistry gR1(F1);
static skiagm::GMRegistry gR2(F2);
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/command_line b/gm/tests/outputs/aaclip-readback/output-expected/command_line
deleted file mode 100644
index db66e2e11e..0000000000
--- a/gm/tests/outputs/aaclip-readback/output-expected/command_line
+++ /dev/null
@@ -1 +0,0 @@
-out/Debug/gm --match simpleaaclip_path --config 8888 --config 565 -r gm/tests/tempfiles/aaclip-images --writeJsonSummary gm/tests/outputs/aaclip-readback/output-actual/json-summary.txt
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt b/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt
deleted file mode 100644
index f5b331947b..0000000000
--- a/gm/tests/outputs/aaclip-readback/output-expected/json-summary.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-{
- "actual-results" : {
- "failed" : null,
- "failure-ignored" : null,
- "no-comparison" : null,
- "succeeded" : {
- "simpleaaclip_path_565" : {
- "checksum" : 14145667878792355483
- },
- "simpleaaclip_path_8888" : {
- "checksum" : 3793109275220252029
- }
- }
- },
- "expected-results" : {
- "simpleaaclip_path_565" : {
- "checksums" : [ 14145667878792355483 ],
- "ignore-failure" : false
- },
- "simpleaaclip_path_8888" : {
- "checksums" : [ 3793109275220252029 ],
- "ignore-failure" : false
- }
- }
-}
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/return_value b/gm/tests/outputs/aaclip-readback/output-expected/return_value
deleted file mode 100644
index 573541ac97..0000000000
--- a/gm/tests/outputs/aaclip-readback/output-expected/return_value
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/gm/tests/outputs/aaclip-readback/output-expected/stdout b/gm/tests/outputs/aaclip-readback/output-expected/stdout
deleted file mode 100644
index 52931ca2a5..0000000000
--- a/gm/tests/outputs/aaclip-readback/output-expected/stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-reading from gm/tests/tempfiles/aaclip-images
-drawing... simpleaaclip_path [640 480]
-Ran 1 tests: 1 passed, 0 failed, 0 missing reference images
diff --git a/gm/tests/outputs/aaclip-write/output-expected/command_line b/gm/tests/outputs/aaclip-write/output-expected/command_line
deleted file mode 100644
index db030e1be5..0000000000
--- a/gm/tests/outputs/aaclip-write/output-expected/command_line
+++ /dev/null
@@ -1 +0,0 @@
-out/Debug/gm --match simpleaaclip_path --config 8888 --config 565 -w gm/tests/tempfiles/aaclip-images --writeJsonSummary gm/tests/outputs/aaclip-write/output-actual/json-summary.txt
diff --git a/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt b/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt
deleted file mode 100644
index 62a2e9f3ff..0000000000
--- a/gm/tests/outputs/aaclip-write/output-expected/json-summary.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-{
- "actual-results" : {
- "failed" : null,
- "failure-ignored" : null,
- "no-comparison" : {
- "simpleaaclip_path_565" : {
- "checksum" : 14145667878792355483
- },
- "simpleaaclip_path_8888" : {
- "checksum" : 3793109275220252029
- }
- },
- "succeeded" : null
- },
- "expected-results" : null
-}
diff --git a/gm/tests/outputs/aaclip-write/output-expected/return_value b/gm/tests/outputs/aaclip-write/output-expected/return_value
deleted file mode 100644
index 573541ac97..0000000000
--- a/gm/tests/outputs/aaclip-write/output-expected/return_value
+++ /dev/null
@@ -1 +0,0 @@
-0
diff --git a/gm/tests/outputs/aaclip-write/output-expected/stdout b/gm/tests/outputs/aaclip-write/output-expected/stdout
deleted file mode 100644
index 87b8e47424..0000000000
--- a/gm/tests/outputs/aaclip-write/output-expected/stdout
+++ /dev/null
@@ -1,3 +0,0 @@
-writing to gm/tests/tempfiles/aaclip-images
-drawing... simpleaaclip_path [640 480]
-Ran 1 tests: 1 passed, 0 failed, 1 missing reference images
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 2fca4157b0..4cfe15127b 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
@@ -2,10 +2,10 @@
"actual-results" : {
"failed" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
},
"failure-ignored" : null,
@@ -14,11 +14,11 @@
},
"expected-results" : {
"565/selftest1" : {
- "checksums" : [ 8143889227369140487 ],
+ "checksums" : [ 11071285354315388429 ],
"ignore-failure" : false
},
"8888/selftest1" : {
- "checksums" : [ 8143889227369140487 ],
+ "checksums" : [ 16527650414256125612 ],
"ignore-failure" : false
}
}
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 2fca4157b0..4cfe15127b 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
@@ -2,10 +2,10 @@
"actual-results" : {
"failed" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
},
"failure-ignored" : null,
@@ -14,11 +14,11 @@
},
"expected-results" : {
"565/selftest1" : {
- "checksums" : [ 8143889227369140487 ],
+ "checksums" : [ 11071285354315388429 ],
"ignore-failure" : false
},
"8888/selftest1" : {
- "checksums" : [ 8143889227369140487 ],
+ "checksums" : [ 16527650414256125612 ],
"ignore-failure" : false
}
}
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 fdc6ab3387..69ef127716 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
@@ -4,10 +4,10 @@
"failure-ignored" : null,
"no-comparison" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
},
"succeeded" : null
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 1fcd8f0b75..cfaf455462 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
@@ -5,20 +5,20 @@
"no-comparison" : null,
"succeeded" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
}
},
"expected-results" : {
"565/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 9512553915271796906 ],
"ignore-failure" : false
},
"8888/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 14022967492765711532 ],
"ignore-failure" : false
}
}
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 1fcd8f0b75..cfaf455462 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
@@ -5,20 +5,20 @@
"no-comparison" : null,
"succeeded" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
}
},
"expected-results" : {
"565/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 9512553915271796906 ],
"ignore-failure" : false
},
"8888/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 14022967492765711532 ],
"ignore-failure" : false
}
}
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 1fcd8f0b75..cfaf455462 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
@@ -5,20 +5,20 @@
"no-comparison" : null,
"succeeded" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
}
},
"expected-results" : {
"565/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 9512553915271796906 ],
"ignore-failure" : false
},
"8888/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 14022967492765711532 ],
"ignore-failure" : false
}
}
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 1fcd8f0b75..cfaf455462 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
@@ -5,20 +5,20 @@
"no-comparison" : null,
"succeeded" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
}
},
"expected-results" : {
"565/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 9512553915271796906 ],
"ignore-failure" : false
},
"8888/selftest1" : {
- "checksums" : [ 9948284449770991531 ],
+ "checksums" : [ 14022967492765711532 ],
"ignore-failure" : false
}
}
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 dbe8a481da..0e19ec194d 100644
--- a/gm/tests/outputs/no-readpath/output-expected/json-summary.txt
+++ b/gm/tests/outputs/no-readpath/output-expected/json-summary.txt
@@ -4,10 +4,10 @@
"failure-ignored" : null,
"no-comparison" : {
"565/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 9512553915271796906
},
"8888/selftest1" : {
- "checksum" : 9948284449770991531
+ "checksum" : 14022967492765711532
}
},
"succeeded" : null
diff --git a/gm/tests/run.sh b/gm/tests/run.sh
index fdfb2f2690..5293ed29d3 100755
--- a/gm/tests/run.sh
+++ b/gm/tests/run.sh
@@ -154,20 +154,4 @@ gm_test "--hierarchy --match selftest1 $CONFIGS -r $GM_INPUTS/images/empty-dir"
# section should be empty.
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.
-#
-# This test would have caught
-# http://code.google.com/p/skia/issues/detail?id=1079 ('gm generating
-# spurious pixel_error messages as of r7258').
-#
-# TODO(epoger): Disabled pending https://code.google.com/p/skia/issues/detail?id=1142
-# ('gm self-tests: aaclip checksums failing')
-#
-#IMAGEDIR=$GM_TEMPFILES/aaclip-images
-#rm -rf $IMAGEDIR
-#mkdir -p $IMAGEDIR
-#gm_test "--match simpleaaclip_path $CONFIGS -w $IMAGEDIR" "$GM_OUTPUTS/aaclip-write"
-#gm_test "--match simpleaaclip_path $CONFIGS -r $IMAGEDIR" "$GM_OUTPUTS/aaclip-readback"
-
echo "All tests passed."