]> granicus.if.org Git - imagemagick/commitdiff
tests/validate.c: Show the reason for failures in the test logs
authorGlenn Randers-Pehrson <glennrp@gmail.com>
Thu, 10 Aug 2017 12:33:43 +0000 (08:33 -0400)
committerGlenn Randers-Pehrson <glennrp@gmail.com>
Thu, 10 Aug 2017 12:33:43 +0000 (08:33 -0400)
ChangeLog
tests/validate.c

index 8e333b2b2bb4e9b0003e08a85928ef273b61023c..c54a9da28153930890c52c9f92695753a528e865 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2017-08-10  7.0.6-6 Glenn Randers-Pehrson <glennrp@image...>
+  * tests/validate.c: Show the reason for failures in the test logs,
+    if available.
+
 2017-08-03  7.0.6-6 Glenn Randers-Pehrson <glennrp@image...>
   * 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).
index be09ceb058721593121eff3e8905bb41c04babe9..aecbad9eb91f5c205cd20fe006a827c4001f8fbf 100644 (file)
@@ -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;