Make --leak-check observe -q properly -- only prints out errors, not general
info and summaries.

MERGE TO STABLE


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@2082 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/memcheck/mac_leakcheck.c b/memcheck/mac_leakcheck.c
index 5084075..a596612 100644
--- a/memcheck/mac_leakcheck.c
+++ b/memcheck/mac_leakcheck.c
@@ -421,8 +421,10 @@
       return;
    }
 
-   VG_(message)(Vg_UserMsg, "searching for pointers to %d not-freed blocks.", 
-                lc_n_shadows );
+   if (VG_(clo_verbosity) > 0)
+      VG_(message)(Vg_UserMsg, 
+                   "searching for pointers to %d not-freed blocks.", 
+                   lc_n_shadows );
 
    lc_min_mallocd_addr = lc_shadows[0]->data;
    lc_max_mallocd_addr = lc_shadows[lc_n_shadows-1]->data
@@ -441,7 +443,8 @@
               &vg_detect_memory_leaks_notify_addr
            );
 
-   VG_(message)(Vg_UserMsg, "checked %d bytes.", bytes_notified);
+   if (VG_(clo_verbosity) > 0)
+      VG_(message)(Vg_UserMsg, "checked %d bytes.", bytes_notified);
 
    /* Common up the lost blocks so we can print sensible error messages. */
    n_lossrecords = 0;
@@ -526,23 +529,24 @@
       p_min->num_blocks = 0;
    }
 
-   VG_(message)(Vg_UserMsg, "");
-   VG_(message)(Vg_UserMsg, "LEAK SUMMARY:");
-   VG_(message)(Vg_UserMsg, "   definitely lost: %d bytes in %d blocks.", 
-                            MAC_(bytes_leaked), blocks_leaked );
-   VG_(message)(Vg_UserMsg, "   possibly lost:   %d bytes in %d blocks.", 
-                            MAC_(bytes_dubious), blocks_dubious );
-   VG_(message)(Vg_UserMsg, "   still reachable: %d bytes in %d blocks.", 
-                            MAC_(bytes_reachable), blocks_reachable );
-   VG_(message)(Vg_UserMsg, "        suppressed: %d bytes in %d blocks.", 
-                            MAC_(bytes_suppressed), blocks_suppressed );
-   if (!MAC_(clo_show_reachable)) {
-      VG_(message)(Vg_UserMsg, 
-        "Reachable blocks (those to which a pointer was found) are not shown.");
-      VG_(message)(Vg_UserMsg, 
-         "To see them, rerun with: --show-reachable=yes");
+   if (VG_(clo_verbosity) > 0) {
+      VG_(message)(Vg_UserMsg, "");
+      VG_(message)(Vg_UserMsg, "LEAK SUMMARY:");
+      VG_(message)(Vg_UserMsg, "   definitely lost: %d bytes in %d blocks.", 
+                               MAC_(bytes_leaked), blocks_leaked );
+      VG_(message)(Vg_UserMsg, "   possibly lost:   %d bytes in %d blocks.", 
+                               MAC_(bytes_dubious), blocks_dubious );
+      VG_(message)(Vg_UserMsg, "   still reachable: %d bytes in %d blocks.", 
+                               MAC_(bytes_reachable), blocks_reachable );
+      VG_(message)(Vg_UserMsg, "        suppressed: %d bytes in %d blocks.", 
+                               MAC_(bytes_suppressed), blocks_suppressed );
+      if (!MAC_(clo_show_reachable)) {
+         VG_(message)(Vg_UserMsg, 
+           "Reachable blocks (those to which a pointer was found) are not shown.");
+         VG_(message)(Vg_UserMsg, 
+            "To see them, rerun with: --show-reachable=yes");
+      }
    }
-   VG_(message)(Vg_UserMsg, "");
 
    VG_(free) ( lc_shadows );
    VG_(free) ( lc_reachedness );
diff --git a/memcheck/tests/nanoleak.stderr.exp b/memcheck/tests/nanoleak.stderr.exp
index 9ed8196..57fdf3c 100644
--- a/memcheck/tests/nanoleak.stderr.exp
+++ b/memcheck/tests/nanoleak.stderr.exp
@@ -1,15 +1,4 @@
-searching for pointers to 1 not-freed blocks.
-checked ... bytes.
 
 1000 bytes in 1 blocks are definitely lost in loss record 1 of 1
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: main (nanoleak.c:6)
-
-LEAK SUMMARY:
-   definitely lost: 1000 bytes in 1 blocks.
-   possibly lost:   0 bytes in 0 blocks.
-   still reachable: 0 bytes in 0 blocks.
-        suppressed: 0 bytes in 0 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-
diff --git a/memcheck/tests/nanoleak_supp.stderr.exp b/memcheck/tests/nanoleak_supp.stderr.exp
index 3e620b3..e69de29 100644
--- a/memcheck/tests/nanoleak_supp.stderr.exp
+++ b/memcheck/tests/nanoleak_supp.stderr.exp
@@ -1,11 +0,0 @@
-searching for pointers to 1 not-freed blocks.
-checked ... bytes.
-
-LEAK SUMMARY:
-   definitely lost: 0 bytes in 0 blocks.
-   possibly lost:   0 bytes in 0 blocks.
-   still reachable: 0 bytes in 0 blocks.
-        suppressed: 1000 bytes in 1 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-
diff --git a/memcheck/tests/trivialleak.stderr.exp b/memcheck/tests/trivialleak.stderr.exp
index ad41678..1bd6e54 100644
--- a/memcheck/tests/trivialleak.stderr.exp
+++ b/memcheck/tests/trivialleak.stderr.exp
@@ -1,16 +1,5 @@
-searching for pointers to 1000 not-freed blocks.
-checked ... bytes.
 
 1000 bytes in 1000 blocks are definitely lost in loss record 1 of 1
    at 0x........: malloc (vg_replace_malloc.c:...)
    by 0x........: test (trivialleak.c:8)
    by 0x........: main (trivialleak.c:12)
-
-LEAK SUMMARY:
-   definitely lost: 1000 bytes in 1000 blocks.
-   possibly lost:   0 bytes in 0 blocks.
-   still reachable: 0 bytes in 0 blocks.
-        suppressed: 0 bytes in 0 blocks.
-Reachable blocks (those to which a pointer was found) are not shown.
-To see them, rerun with: --show-reachable=yes
-