[cairo] cairo tests depend on PNG functions

Jason Dorje Short jdorje at users.sf.net
Wed Mar 30 14:41:33 PST 2005


Jason Dorje Short wrote:
> If libpng isn't available then the cairo PNG functions won't be 
> available and the cairo tests won't be able to compile - a bug.
> 
> This patch simply disables the test program if the PNG functions aren't 
> available.  Note the test program doesn't (yet) use the cairo PNG 
> functions; it uses libpng directly (read-png.c and write-png.c).  But 
> the condition for success is the same (libpng being present).

The previous patch allowed 'make' to run without libpng, but 'make 
check' would still fail.  The imagediff program is built as part of 
'make', but other tests are included with 'make check'.

This patch allows 'make check' to run as well.

* imagediff is built as part of the TESTS (in 'make check').
* All tests are disabled if PNG isn't available.

It was suggested that there should be a log message "Can't run tests 
without PNG" if 'make check' was run and the PNG functions weren't 
available.  I don't know how to do this in the context of automake 
(except maybe by making another script that runs as the only entry in 
TESTS in this case, and simply prints this message).  Maybe it is 
sufficient to move all of the libraries and programs in test/ into the 
check_PROGRAMS and check_LTLIBRARIES so they are only built on 'make 
check' - then 'make' will always succeed (it won't do anything in the 
test/ directory) but 'make check' will simply fail at the compile stage 
if PNG isn't available.

-jason
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-2.diff
Type: text/x-patch
Size: 1434 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050330/39fd5964/test-2.bin


More information about the cairo mailing list