From 6497cf7ca42b69e3172c07a5151e1cbf475e8c17 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jos=C3=A9=20Fonseca?= Date: Tue, 4 Dec 2012 03:19:16 +0000 Subject: [PATCH] cli: Don't rely on image generation for diff-image tests. Use static images instead. --- cli/cli-diff-images-mismatch.script | 15 ++------------- cli/cli-diff-images.script | 14 ++------------ cli/images/black-1x1/0.png | Bin 0 -> 216 bytes cli/images/white-1x1/0.png | Bin 0 -> 216 bytes 4 files changed, 4 insertions(+), 25 deletions(-) create mode 100644 cli/images/black-1x1/0.png create mode 100644 cli/images/white-1x1/0.png diff --git a/cli/cli-diff-images-mismatch.script b/cli/cli-diff-images-mismatch.script index 995b7e5..15446ad 100644 --- a/cli/cli-diff-images-mismatch.script +++ b/cli/cli-diff-images-mismatch.script @@ -1,18 +1,7 @@ -# The first two steps are just as in cli-diff-images. Dump images from -# a trace into an empty directory. - -rm_and_mkdir ./tri-out -apitrace dump-images --call-nos=no -o ./tri-out/tri tri.trace - -# Compare the dumped image with a doctored image to provoke a failure. -# The EXPECT_FAILURE attribute causes the test driver to look for a -# non-zero return value from apitrace and fail the test if it is not -# seen. - -EXPECT_FAILURE: apitrace diff-images -v ./tri-ref-mismatch ./tri-out +EXPECT_FAILURE: apitrace diff-images --verbose images/white-1x1/ images/black-1x1/ # In addition to getting the return value indicating an error, let's # also require that "apitrace diff-images" gave us the output we # expect. -expect "Comparing ./tri-ref-mismatch/tri0000000000.png and ./tri-out/tri0000000000.png ... MISMATCH\n" +expect "Comparing images/white-1x1/0.png and images/black-1x1/0.png ... MISMATCH\n" diff --git a/cli/cli-diff-images.script b/cli/cli-diff-images.script index 90d27cc..27327d4 100644 --- a/cli/cli-diff-images.script +++ b/cli/cli-diff-images.script @@ -1,18 +1,8 @@ -# Make a directory for the output images - -rm_and_mkdir ./tri-out - -# Generate images for every frame (only 1) of a trace - -apitrace dump-images --call-nos=no -o ./tri-out/tri tri.trace - -# Compare the result of "apitrace dump-images" with our reference - -apitrace diff-images -v ./tri-ref ./tri-out +apitrace diff-images --verbose images/white-1x1/ images/white-1x1/ # Ensure that the "apitrace diff-images" actually did something. This # is important since if it couldn't find images in one directory or # the other then it would just silently return 0 and this test would # incorrectly pass. -expect "Comparing ./tri-ref/tri0000000000.png and ./tri-out/tri0000000000.png ... MATCH\n" +expect "Comparing images/white-1x1/0.png and images/white-1x1/0.png ... MATCH\n" diff --git a/cli/images/black-1x1/0.png b/cli/images/black-1x1/0.png new file mode 100644 index 0000000000000000000000000000000000000000..12b0fd3bb53401b33c22f0a5a6bf9f69f9e5ae33 GIT binary patch literal 216 zcmeAS@N?(olHy`uVBq!ia0vp^j35jm7|ip2ssJgLbVpxD2FA7phA*bY1Nlrz-tI08 zjCZ?)mjHR31s;*bK-vS0-A-oP0U2DLE{-7_*OL=~Y$gWAM~Zulfh^S$*NBpo#FA92 z?VfByUtl(fGpJ#*NBpo#FA92 zcptHiD0`1$wCfEpM) MUHx3vIVCg!0Q1Z=aR2}S literal 0 HcmV?d00001 -- 2.43.0