From 0004c256c02479f99f4e20743e3e1cc313eba824 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Thu, 10 Aug 2017 08:33:43 -0400 Subject: [PATCH] tests/validate.c: Show the reason for failures in the test logs --- ChangeLog | 4 ++++ tests/validate.c | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8e333b2b2..c54a9da28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2017-08-10 7.0.6-6 Glenn Randers-Pehrson + * tests/validate.c: Show the reason for failures in the test logs, + if available. + 2017-08-03 7.0.6-6 Glenn Randers-Pehrson * Put UTC time in the PNG tIME chunk instead of local time (reference https://www.imagemagick.org/discourse-server/viewtopic.php?f=3&t=32447). diff --git a/tests/validate.c b/tests/validate.c index be09ceb05..aecbad9eb 100644 --- a/tests/validate.c +++ b/tests/validate.c @@ -1174,6 +1174,8 @@ static size_t ValidateCompareCommand(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + (void) LogMagickEvent(ExceptionEvent,GetMagickModule(), + "%s",exception->reason); (*fail)++; continue; } @@ -1186,6 +1188,8 @@ static size_t ValidateCompareCommand(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + (void) LogMagickEvent(ExceptionEvent,GetMagickModule(), + "%s",exception->reason); (*fail)++; continue; } @@ -1586,6 +1590,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; @@ -1604,6 +1611,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; reference_image=DestroyImage(reference_image); @@ -1626,6 +1636,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; @@ -1641,6 +1654,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; @@ -1655,6 +1671,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; @@ -1675,6 +1694,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; reference_image=DestroyImage(reference_image); @@ -1689,6 +1711,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; blob=(unsigned char *) RelinquishMagickMemory(blob); @@ -1707,6 +1732,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; reference_image=DestroyImage(reference_image); @@ -1727,6 +1755,9 @@ static size_t ValidateImageFormatsInMemory(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; @@ -1849,6 +1880,9 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; @@ -1867,6 +1901,9 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; reference_image=DestroyImage(reference_image); @@ -1889,6 +1926,9 @@ static size_t ValidateImageFormatsOnDisk(ImageInfo *image_info, { (void) FormatLocaleFile(stdout,"... fail @ %s/%s/%lu.\n", GetMagickModule()); + if (exception->reason) + (void) FormatLocaleFile(stdout, + " reason:%s\n",exception->reason); CatchException(exception); (*fail)++; continue; -- 2.40.0