Only use exit(77) in configure builds

Signed-off-by: John Bowler <jbowler@acm.org>
This commit is contained in:
John Bowler 2016-01-26 17:55:39 -08:00
parent e0ce90ea0a
commit ac796d3f9a
5 changed files with 47 additions and 10 deletions

View File

@ -36,6 +36,15 @@
# include <setjmp.h> /* because png.h did *not* include this */
#endif
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
*/
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
# define SKIP 77
#else
# define SKIP 0
#endif
#if defined(PNG_INFO_IMAGE_SUPPORTED) && defined(PNG_SEQUENTIAL_READ_SUPPORTED)\
&& (defined(PNG_READ_PNG_SUPPORTED) || PNG_LIBPNG_VER < 10700)
/* If a transform is valid on both read and write this implies that if the
@ -1682,6 +1691,6 @@ int
main(void)
{
fprintf(stderr, "pngimage: no support for png_read/write_image\n");
return 77;
return SKIP;
}
#endif

View File

@ -26,6 +26,15 @@
# include <config.h>
#endif
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
*/
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
# define SKIP 77
#else
# define SKIP 0
#endif
/* Define the following to use this test against your installed libpng, rather
* than the one being built here:
*/
@ -3470,7 +3479,7 @@ main(int argc, char **argv)
# ifdef PNG_STDIO_SUPPORTED
opts |= USE_FILE;
# else
return 77; /* skipped: no support */
return SKIP; /* skipped: no support */
# endif
else if (strcmp(arg, "--memory") == 0)
opts &= ~USE_FILE;
@ -3478,7 +3487,7 @@ main(int argc, char **argv)
# ifdef PNG_STDIO_SUPPORTED
opts |= USE_STDIO;
# else
return 77; /* skipped: no support */
return SKIP; /* skipped: no support */
# endif
else if (strcmp(arg, "--name") == 0)
opts &= ~USE_STDIO;
@ -3764,6 +3773,6 @@ int main(void)
{
fprintf(stderr, "pngstest: no read support in libpng, test skipped\n");
/* So the test is skipped: */
return 77;
return SKIP;
}
#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */

View File

@ -30,6 +30,16 @@
# include "../../png.h"
#endif
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
*/
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
# define SKIP 77
#else
# define SKIP 0
#endif
/* Since this program tests the ability to change the unknown chunk handling
* these must be defined:
*/
@ -1260,7 +1270,7 @@ main(void)
fprintf(stderr,
" test ignored: no support to find out about unknown chunks\n");
/* So the test is skipped: */
return 77;
return SKIP;
}
#endif /* READ_USER_CHUNKS || SAVE_UNKNOWN_CHUNKS */
@ -1271,6 +1281,6 @@ main(void)
fprintf(stderr,
" test ignored: no support to modify unknown chunk handling\n");
/* So the test is skipped: */
return 77;
return SKIP;
}
#endif /* SET_UNKNOWN_CHUNKS && READ*/

View File

@ -62,10 +62,10 @@
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
*/
#if PNG_LIBPNG_VER < 10601
# define SKIP 0
#else
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
# define SKIP 77
#else
# define SKIP 0
#endif
/* pngvalid requires write support and one of the fixed or floating point APIs.

View File

@ -43,6 +43,15 @@
#include "png.h"
/* 1.6.1 added support for the configure test harness, which uses 77 to indicate
* a skipped test, in earlier versions we need to succeed on a skipped test, so:
*/
#if PNG_LIBPNG_VER >= 10601 && defined(HAVE_CONFIG_H)
# define SKIP 77
#else
# define SKIP 0
#endif
/* Known chunks that exist in pngtest.png must be supported or pngtest will fail
* simply as a result of re-ordering them. This may be fixed in 1.7
*
@ -2065,7 +2074,7 @@ main(void)
fprintf(STDERR,
" test ignored because libpng was not built with read support\n");
/* And skip this test */
return PNG_LIBPNG_VER < 10600 ? 0 : 77;
return SKIP;
}
#endif