fix wording
[swfdec.git] / test / image / README
bloba43094360dadf550be6d14309320735a0f68a934
1 This directory contains tests for testing the rendering output of Swfdec
3 What tests belong here?
5 If you want to make sure the images produced by Swfdec are correct, this is 
6 the place to start.
9 How does it work?
11   ./image [FILE1 [FILE2 [...]]]
12 The program image in this directory takes all files on the command line or all
13 files in the current directory and runs them. Running consists of instancing a
14 SwfdecPlayer and advancing $FILE 10 times. After that, the current state of 
15 the player is rendered to an image and compared to the reference image named
16 $FILE.png. The image must be in PNG format. Comparing in this context means
17 checking that the difference between the red, green, blue and alpha channel for
18 every pixel isn't greater than a given threshold. Currently the threshold is
19 set to 3 to account for rounding errors.
20 If the environment variable SWFDEC_TEST_DUMP is set, for every failed test the
21 image containing the player's output is dumped to $FILE.dump.png. If available,
22 a difference image detailing the differences between the reference image and
23 the current image is saved to $FILE.diff.png.
26 How do I run my new test?
28 Create a file to test, say "test.swf", and create a corresponding file for the
29 expected output image. In this case that would be "test.swf.png". After that, 
30 just call the image application with your file, like this:
31   ./image test.swf
32 You may need to build the image application if you haven't run make check 
33 before, just run make image.
36 How do I create the expected reference image?
38 Ideally you create a SWF file where the image doesn't change. Alternatively
39 use a low frame rate. Play the file with the Adobe Flash Player in Wine and 
40 take a screenshot of its output.
41 If the Swfdec output doesn't match exactly, but is close enough, use that 
42 output as the reference image but keep the original expected output, too. Name
43 it $FILE.org.png.
46 How do I add a test to the testsuite?
48 Just put the file and its reference image - and the original reference image, 
49 too, if available (see above) - into this directory and add them all
50 to EXTRA_DIST in Makefile.am. It should appear in the output when running 
51 make check. (Note that the order of files tested during make check is pretty 
52 much random.)