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

@@ -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 */