From 8e25a61277218608be08874f159cf0a327fd6c0b Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Mon, 26 Sep 2011 20:57:33 -0500 Subject: [PATCH] [libpng15]` Revised test-pngtest.sh to report FAIL when pngtest fails. Added "--strict" option to pngtest, to report FAIL when the failure is only because the resulting valid files are different. --- ANNOUNCE | 7 +++++-- CHANGES | 5 ++++- pngtest.c | 25 ++++++++++++++++++++++--- test-pngtest.sh | 10 +++++++++- 4 files changed, 40 insertions(+), 7 deletions(-) diff --git a/ANNOUNCE b/ANNOUNCE index 050f30e5d..5cff8c131 100644 --- a/ANNOUNCE +++ b/ANNOUNCE @@ -1,5 +1,5 @@ -Libpng 1.5.6beta03 - September 26, 2011 +Libpng 1.5.6beta03 - September 27, 2011 This is not intended to be a public release. It will be replaced within a few weeks by a public version or by another test version. @@ -45,7 +45,10 @@ Version 1.5.6beta02 [Septhember 26, 2011] once with a particular info_ptr. Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro. -Version 1.5.6beta03 [September 26, 2011] +Version 1.5.6beta03 [September 27, 2011] + Revised test-pngtest.sh to report FAIL when pngtest fails. + Added "--strict" option to pngtest, to report FAIL when the failure is + only because the resulting valid files are different. Send comments/corrections/commendations to png-mng-implement at lists.sf.net: (subscription required; visit diff --git a/CHANGES b/CHANGES index 4e62d12ba..dec424f01 100644 --- a/CHANGES +++ b/CHANGES @@ -3606,7 +3606,10 @@ Version 1.5.6beta02 [Septhember 26, 2011] once with a particular info_ptr. Fixed a typo in the definition of the new PNG_STRING_FROM_CHUNK(s,c) macro. -Version 1.5.6beta03 [September 26, 2011] +Version 1.5.6beta03 [September 27, 2011] + Revised test-pngtest.sh to report FAIL when pngtest fails. + Added "--strict" option to pngtest, to report FAIL when the failure is + only because the resulting valid files are different. Send comments/corrections/commendations to png-mng-implement at lists.sf.net (subscription required; visit diff --git a/pngtest.c b/pngtest.c index 56987771c..76fc9efa3 100644 --- a/pngtest.c +++ b/pngtest.c @@ -1,7 +1,7 @@ /* pngtest.c - a simple test program to test libpng * - * Last changed in libpng 1.5.4 [July 7, 2011] + * Last changed in libpng 1.5.6 [(PENDING RELEASE)] * Copyright (c) 1998-2011 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) @@ -98,6 +98,7 @@ static char tIME_string[PNG_tIME_STRING_LENGTH] = "tIME chunk is not present"; #endif static int verbose = 0; +static int strict = 0; int test_one_file PNGARG((PNG_CONST char *inname, PNG_CONST char *outname)); @@ -1479,7 +1480,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) FCLOSE(fpin); FCLOSE(fpout); - return (0); + + if (strict != 0) + return (1); + + else + return (0); } if (!num_in) @@ -1504,7 +1510,12 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname) FCLOSE(fpin); FCLOSE(fpout); - return (0); + + if (strict != 0) + return (1); + + else + return (0); } } @@ -1586,6 +1597,14 @@ main(int argc, char *argv[]) inname = argv[2]; } + else if (strcmp(argv[1], "--strict") == 0) + { + status_dots_requested = 0; + verbose = 1; + inname = argv[2]; + strict++; + } + else { inname = argv[1]; diff --git a/test-pngtest.sh b/test-pngtest.sh index 5d12f4acb..bba128b63 100755 --- a/test-pngtest.sh +++ b/test-pngtest.sh @@ -5,4 +5,12 @@ echo "Running tests. For details see pngtest-log.txt" echo "============ pngtest pngtest.png ==============" > pngtest-log.txt echo "Running test-pngtest.sh" -./pngtest ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1 +if ./pngtest --strict ${srcdir}/pngtest.png >> pngtest-log.txt 2>&1 +then + echo " PASS: pngtest --strict pngtest.png" + err=0 +else + echo " FAIL: pngtest --strict pngtest.png" + err=1 +fi +exit $err