diff options
author | Leon Scroggins III <scroggo@google.com> | 2016-12-06 10:58:02 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2016-12-06 16:57:40 +0000 |
commit | 83926346f106a63e72e768614ebc70c6d4c93b6f (patch) | |
tree | 693b62f7eeb14981a433271133e2b24f29bfd3c7 | |
parent | 7a758eb1a144569ded3cf4335bd21da53a21ee54 (diff) |
Divide up CodecTest
Split up DEF_TEST(Codec, r) by type. Frequently when I am testing
locally I only want to test one type (e.g. I am testing changes to
SkGifCodec), and this allows me to skip past the ones I do not care
about.
It also speeds up my local runs, since most of the time is spent in
this single long test. Splitting them up means they can run in
parallel, halving run time. (Probably doesn't make a big difference
on bots, where more tests are running.)
Change-Id: Ic6babc20e1288dbb4fb255290f71523a033c7559
Reviewed-on: https://skia-review.googlesource.com/5622
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Matt Sarett <msarett@google.com>
-rw-r--r-- | tests/CodecTest.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/tests/CodecTest.cpp b/tests/CodecTest.cpp index dd969960dc..bbe88d7d3d 100644 --- a/tests/CodecTest.cpp +++ b/tests/CodecTest.cpp @@ -455,34 +455,38 @@ static void check(skiatest::Reporter* r, } } -DEF_TEST(Codec, r) { - // WBMP +DEF_TEST(Codec_wbmp, r) { check(r, "mandrill.wbmp", SkISize::Make(512, 512), true, false, true); +} - // WEBP +DEF_TEST(Codec_webp, r) { check(r, "baby_tux.webp", SkISize::Make(386, 395), false, true, true); check(r, "color_wheel.webp", SkISize::Make(128, 128), false, true, true); check(r, "yellow_rose.webp", SkISize::Make(400, 301), false, true, true); +} - // BMP +DEF_TEST(Codec_bmp, r) { check(r, "randPixels.bmp", SkISize::Make(8, 8), true, false, true); check(r, "rle.bmp", SkISize::Make(320, 240), true, false, true); +} - // ICO +DEF_TEST(Codec_ico, r) { // FIXME: We are not ready to test incomplete ICOs // These two tests examine interestingly different behavior: // Decodes an embedded BMP image check(r, "color_wheel.ico", SkISize::Make(128, 128), true, false, false); // Decodes an embedded PNG image check(r, "google_chrome.ico", SkISize::Make(256, 256), false, false, false, true); +} - // GIF +DEF_TEST(Codec_gif, r) { check(r, "box.gif", SkISize::Make(200, 55), false, false, true, true); check(r, "color_wheel.gif", SkISize::Make(128, 128), false, false, true, true); // randPixels.gif is too small to test incomplete check(r, "randPixels.gif", SkISize::Make(8, 8), false, false, false, true); +} - // JPG +DEF_TEST(Codec_jpg, r) { check(r, "CMYK.jpg", SkISize::Make(642, 516), true, false, true); check(r, "color_wheel.jpg", SkISize::Make(128, 128), true, false, true); // grayscale.jpg is too small to test incomplete @@ -490,8 +494,9 @@ DEF_TEST(Codec, r) { check(r, "mandrill_512_q075.jpg", SkISize::Make(512, 512), true, false, true); // randPixels.jpg is too small to test incomplete check(r, "randPixels.jpg", SkISize::Make(8, 8), true, false, false); +} - // PNG +DEF_TEST(Codec_png, r) { check(r, "arrow.png", SkISize::Make(187, 312), false, false, true, true); check(r, "baby_tux.png", SkISize::Make(240, 246), false, false, true, true); check(r, "color_wheel.png", SkISize::Make(128, 128), false, false, true, true); @@ -507,15 +512,16 @@ DEF_TEST(Codec, r) { check(r, "plane_interlaced.png", SkISize::Make(250, 126), false, false, true, true); check(r, "randPixels.png", SkISize::Make(8, 8), false, false, true, true); check(r, "yellow_rose.png", SkISize::Make(400, 301), false, false, true, true); +} - // RAW // Disable RAW tests for Win32. #if defined(SK_CODEC_DECODES_RAW) && (!defined(_WIN32)) +DEF_TEST(Codec_raw, r) { check(r, "sample_1mp.dng", SkISize::Make(600, 338), false, false, false); check(r, "sample_1mp_rotated.dng", SkISize::Make(600, 338), false, false, false); check(r, "dng_with_preview.dng", SkISize::Make(600, 338), true, false, false); -#endif } +#endif static void test_invalid_stream(skiatest::Reporter* r, const void* stream, size_t len) { // Neither of these calls should return a codec. Bots should catch us if we leaked anything. @@ -963,7 +969,7 @@ DEF_TEST(Codec_webp_peek, r) { // It required the second byte to be zero. The wbmp specification allows // a couple of bits to be 1 (so long as they do not overlap with 0x9F). // Test that SkCodec now supports an image with these bits set. -DEF_TEST(Codec_wbmp, r) { +DEF_TEST(Codec_wbmp_restrictive, r) { const char* path = "mandrill.wbmp"; std::unique_ptr<SkStream> stream(GetResourceAsStream(path)); if (!stream) { |