[Swfdec] test/image

Benjamin Otte company at kemper.freedesktop.org
Tue Feb 6 06:13:46 PST 2007


 test/image/Makefile.am |    1 
 test/image/README      |   52 +++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 53 insertions(+)

New commits:
diff-tree 4da13f915d871a6e0e3495967275cee5661eb064 (from ee3339e4cb9af7e52a6ecb381206f1ea5adb07c0)
Author: Benjamin Otte <otte at gnome.org>
Date:   Tue Feb 6 15:13:28 2007 +0100

    add README for image directory

diff --git a/test/image/Makefile.am b/test/image/Makefile.am
index 3ba1485..2e1bbba 100644
--- a/test/image/Makefile.am
+++ b/test/image/Makefile.am
@@ -6,6 +6,7 @@ image_CFLAGS = $(GLOBAL_CFLAGS) $(SWF_CF
 image_LDFLAGS = $(SWF_LIBS) $(CAIRO_LIBS)
 
 EXTRA_DIST = \
+	README \
 	color-transform-add80.swf \
 	color-transform-add80.swf.png \
 	color-transform-add80-alpha.swf \
diff --git a/test/image/README b/test/image/README
new file mode 100644
index 0000000..53f2873
--- /dev/null
+++ b/test/image/README
@@ -0,0 +1,52 @@
+This directory contains tests thting the sound output of Swfdec
+
+What tests belong here?
+
+If you want to make sure the images produced by Swfdec are correct, this is 
+the place to start.
+
+
+How does it work?
+
+  ./image [FILE1 [FILE2 [...]]]
+The program image in this directory takes all files on the command line or all
+files in the current directory and runs them. Running consists of instancing a
+SwfdecPlayer and advancing $FILE 10 times. After that, the current state of 
+the player is rendered to an image and compared to the reference image named
+$FILE.png. The image must be in PNG format. Comparing in this context means
+checking that the difference between the red, green, blue and alpha channel for
+every pixel isn't greater than a given threshold. Currently the threshold is
+set to 3 to account for rounding errors.
+If the environment variable SWFDEC_TEST_DUMP is set, for every failed test the
+image containing the player's output is dumped to $FILE.dump.png. If available,
+a difference image detailing the differences between the reference image and
+the current image is saved to $FILE.diff.png.
+
+
+How do I run my new test?
+
+Create a file to test, say "test.swf", and create a corresponding file for the
+expected output image. In this case that would be "test.swf.png". After that, 
+just call the image application with your file, like this:
+  ./image test.swf
+You may need to build the image application if you haven't run make check 
+before, just run make image.
+
+
+How do I create the expected reference image?
+
+Ideally you create a SWF file where the image doesn't change. Alternatively
+use a low frame rate. Play the file with the Adobe Flash Player in Wine and 
+take a screenshot of its output.
+If the Swfdec output doesn't match exactly, but is close enough, use that 
+output as the reference image but keep the original expected output, too. Name
+it $FILE.org.png.
+
+
+How do I add a test to the testsuite?
+
+Just put the file and its reference image - and the original reference image, 
+too, if available (see above) - into this directory and add them all
+to EXTRA_DIST in Makefile.am. It should appear in the output when running 
+make check. (Note that the order of files tested during make check is pretty 
+much random.)


More information about the Swfdec mailing list