diff options
author | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-27 20:21:01 +0000 |
---|---|---|
committer | scroggo@google.com <scroggo@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-06-27 20:21:01 +0000 |
commit | bc91e8b7d759e40d669f153ac2feff39b60a9059 (patch) | |
tree | fb2276e0f85f30c2054e4bddefcefac72b3e9486 /tools | |
parent | 6e49c345b132ca55830c7dad746108cd3624eb8b (diff) |
Fix run_decoding_tests on xoom.
Builder Test-Android-Xoom-Tegra2-Arm7-Debug fails run_decoding_tests
due to a couple of images. Add a way in skimage to ignore failures
if an image is expected to fail. Add an expectations file for xoom
that includes ignore-failure for the two files which are failing.
I have created https://code.google.com/p/skia/issues/detail?id=1382
to track the fact that these images fail to decode, despite the bot
showing green.
R=borenet@google.com
Review URL: https://codereview.chromium.org/18023008
git-svn-id: http://skia.googlecode.com/svn/trunk@9797 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'tools')
-rw-r--r-- | tools/skimage_main.cpp | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/tools/skimage_main.cpp b/tools/skimage_main.cpp index 01dbc468f1..572f9f54f6 100644 --- a/tools/skimage_main.cpp +++ b/tools/skimage_main.cpp @@ -164,6 +164,18 @@ static void write_expectations(const SkBitmap& bitmap, const char* filename) { } /** + * Return true if this filename is a known failure, and therefore a failure + * to decode should be ignored. + */ +static bool expect_to_fail(const char* filename) { + if (NULL == gJsonExpectations.get()) { + return false; + } + skiagm::Expectations jsExpectations = gJsonExpectations->get(filename); + return jsExpectations.ignoreFailure(); +} + +/** * Compare against an expectation for this filename, if there is one. * @param bitmap SkBitmap to compare to the expected value. * @param filename String used to find the expected value. @@ -299,16 +311,22 @@ static void decodeFileAndWrite(const char srcPath[], const SkString* writePath) SkAutoTDelete<SkImageDecoder> ad(codec); stream.rewind(); - if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, - SkImageDecoder::kDecodePixels_Mode)) { - gDecodeFailures.push_back().set(srcPath); - return; - } // Create a string representing just the filename itself, for use in json expectations. SkString basename = SkOSPath::SkBasename(srcPath); const char* filename = basename.c_str(); + if (!codec->decode(&stream, &bitmap, SkBitmap::kARGB_8888_Config, + SkImageDecoder::kDecodePixels_Mode)) { + if (expect_to_fail(filename)) { + gSuccessfulDecodes.push_back().appendf( + "failed to decode %s, which is a known failure.", srcPath); + } else { + gDecodeFailures.push_back().set(srcPath); + } + return; + } + if (compare_to_expectations_if_necessary(bitmap, filename, &gDecodeFailures)) { gSuccessfulDecodes.push_back().printf("%s [%d %d]", srcPath, bitmap.width(), bitmap.height()); |