dirmngr: Register hkp-cacert even if the file doesn't exist yet
[gnupg.git] / g10 / test.c
index 59a015c..734458a 100644 (file)
@@ -14,7 +14,7 @@
  * GNU General Public License for more details.
  *
  * You should have received a copy of the GNU General Public License
- * along with this program; if not, see <http://www.gnu.org/licenses/>.
+ * along with this program; if not, see <https://www.gnu.org/licenses/>.
  */
 
 #include <config.h>
@@ -63,20 +63,24 @@ static int verbose;
     int expected_result;                       \
                                                \
     tests ++;                                  \
-                                               \
-    printf ("%d. Checking %s...",              \
-           tests, (description) ?: "");        \
-    fflush (stdout);                           \
-                                               \
+    if (verbose)                                \
+      {                                         \
+         printf ("%d. Checking %s...",         \
+               tests, (description) ?: "");    \
+         fflush (stdout);                      \
+      }                                         \
     test_result = (test);                      \
     expected_result = (expected);              \
                                                \
     if (test_result == expected_result)                \
       {                                                \
-        printf (" ok.\n");                     \
+        if (verbose) printf (" ok.\n");         \
       }                                                \
     else                                       \
       {                                                \
+        if (!verbose)                           \
+          printf ("%d. Checking %s...",         \
+                  tests, (description) ?: "");  \
        printf (" failed.\n");                  \
        printf ("  %s == %s failed.\n",         \
                STRINGIFY(test),                \
@@ -124,7 +128,8 @@ exit_tests (int force)
 {
   if (tests_failed == 0)
     {
-      printf ("All %d tests passed.\n", tests);
+      if (verbose)
+        printf ("All %d tests passed.\n", tests);
       exit (!!force);
     }
   else