Browse Source

better counting for suppressions in scope-modes touched and new.

avkonst 11 years ago
parent
commit
1addfa749b

+ 37 - 22
mainline/ext/std/tools/view.py

@@ -95,6 +95,7 @@ def export_to_str(out_format, paths, loader, loader_prev, nest_regions, dist_col
         path = mpp.utils.preprocess_path(path)
         
         aggregated_data, aggregated_data_prev = load_aggregated_data_with_mode(loader, loader_prev, path , mode)
+        
         aggregated_data_tree = {}
         subdirs = []
         subfiles = []
@@ -105,10 +106,14 @@ def export_to_str(out_format, paths, loader, loader_prev, nest_regions, dist_col
         else:
             mpp.utils.report_bad_path(path)
             exit_code += 1
+        aggregated_data_tree = append_suppressions(path, aggregated_data_tree, loader, mode)
+
         if aggregated_data_prev != None:
+            aggregated_data_prev_tree = aggregated_data_prev.get_data_tree()
+            aggregated_data_prev_tree = append_suppressions(path, aggregated_data_prev_tree, loader, mode)
             aggregated_data_tree = append_diff(aggregated_data_tree,
-                                           aggregated_data_prev.get_data_tree())
-        aggregated_data_tree = append_suppressions(path, aggregated_data_tree, loader)
+                                               aggregated_data_prev_tree)
+            
         aggregated_data_tree = compress_dist(aggregated_data_tree, dist_columns)
         
         file_data = loader.load_file_data(path)
@@ -163,7 +168,8 @@ def load_aggregated_data_with_mode(loader, loader_prev, path, mode):
                             'max': None,
                             'total': 0.0,
                             'avg': None,
-                            'distribution-bars': {}
+                            'distribution-bars': {},
+                            'sup': 0
                         })
                         
             def get_data_tree(self, namespaces=None):
@@ -189,6 +195,7 @@ def load_aggregated_data_with_mode(loader, loader_prev, path, mode):
                 # flag to protect ourselves from getting incomplete data
                 # the workflow in this tool: append data first and after get it using get_data_tree()
                 assert(self.in_processing_mode == True)
+                sup_data = orig_data.get_data('std.suppress', 'list')
                 data = orig_data.get_data_tree()
                 for namespace in data.keys():
                     for field in data[namespace].keys():
@@ -204,6 +211,9 @@ def load_aggregated_data_with_mode(loader, loader_prev, path, mode):
                         if metric_value not in aggr_data['distribution-bars'].keys():
                             aggr_data['distribution-bars'][metric_value] = 0
                         aggr_data['distribution-bars'][metric_value] += 1
+                        if sup_data != None:
+                            if sup_data.find('{0}:{1}'.format(namespace, field)) != -1:
+                                aggr_data['sup'] += 1
                         self.set_data(namespace, field, aggr_data)
             
             def _append_file_data(self, file_data):
@@ -372,22 +382,23 @@ def append_diff_list(main_list, prev_list):
                        '__diff__':merged_list[metric]['__diff__']})
     return result
 
-def append_suppressions(path, data, loader):
-    # TODO can not append right suppressions for mode != ALL, fix it
-    for namespace in data.keys():
-        for field in data[namespace].keys():
-            selected_data = loader.load_selected_data('std.suppress',
-                                       fields = ['list'],
-                                       path=path,
-                                       filters = [('list', 'LIKE', '%[{0}:{1}]%'.format(namespace, field))])
-            if selected_data == None:
-                data[namespace][field]['sup'] = 0
-            else:
-                count = 0
-                for each in selected_data:
-                    each = each # used
-                    count += 1
-                data[namespace][field]['sup'] = count
+def append_suppressions(path, data, loader, mode):
+    if mode == Plugin.MODE_ALL:
+        # in other modes, suppressions are appended during data loading
+        for namespace in data.keys():
+            for field in data[namespace].keys():
+                selected_data = loader.load_selected_data('std.suppress',
+                                           fields = ['list'],
+                                           path=path,
+                                           filters = [('list', 'LIKE', '%[{0}:{1}]%'.format(namespace, field))])
+                if selected_data == None:
+                    data[namespace][field]['sup'] = 0
+                else:
+                    count = 0
+                    for each in selected_data:
+                        each = each # used
+                        count += 1
+                    data[namespace][field]['sup'] = count
     return data
 
 def compress_dist(data, columns):
@@ -581,16 +592,20 @@ def cout_txt(data, loader):
             measured = data['aggregated-data'][namespace][field]['count']
             if 'count' in diff_data.keys():
                 diff_str = ' [{0:{1}}]'.format(diff_data['count'], '+' if diff_data['count'] >= 0 else '')
-            count_str_len  = len(str(measured))
+            sup_diff_str = ""
+            if 'sup' in diff_data.keys():
+                sup_diff_str = ' [{0:{1}}]'.format(diff_data['sup'], '+' if diff_data['sup'] >= 0 else '')
             elem_name = 'regions'
             if loader.get_namespace(namespace).are_regions_supported() == False:
                 elem_name = 'files'
             details.append(('Distribution',
-                            '{0}{1} {2} in total (including {3} suppressed)'.format(measured,
+                            '{0}{1} {2} in total (including {3}{4} suppressed)'.format(measured,
                                                                                    diff_str,
                                                                                    elem_name,
-                                                                                   data['aggregated-data'][namespace][field]['sup'])))
+                                                                                   data['aggregated-data'][namespace][field]['sup'],
+                                                                                   sup_diff_str)))
             details.append(('  Metric value', 'Ratio : R-sum : Number of ' + elem_name))
+            count_str_len  = len(str(measured))
             sum_ratio = 0
             for bar in data['aggregated-data'][namespace][field]['distribution-bars']:
                 sum_ratio += bar['ratio']

+ 1 - 1
mainline/tests/general/test_basic/test_view_format_view_nest_per_file_stdout.gold.txt

@@ -93,13 +93,13 @@
         <aggregated-data>
             <std.code.complexity>
                 <cyclomatic nonzero="False" count="6" total="8.0" min="0" max="3" avg="1.33333333333" sup="0">
+                    <__diff__ nonzero="0" count="0" avg="-0.166666666667" min="-1" max="0" total="-1.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="1" metric="0" ratio="0.166666666667" />
                         <distribution-bar count="3" __diff__="-1" metric="1" ratio="0.5" />
                         <distribution-bar count="1" __diff__="0" metric="2" ratio="0.166666666667" />
                         <distribution-bar count="1" __diff__="0" metric="3" ratio="0.166666666667" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="0" avg="-0.166666666667" min="-1" max="0" total="-1.0" />
                 </cyclomatic>
             </std.code.complexity>
         </aggregated-data>

+ 1 - 1
mainline/tests/general/test_basic/test_view_format_view_nest_stdout.gold.txt

@@ -11,13 +11,13 @@
         <aggregated-data>
             <std.code.complexity>
                 <cyclomatic nonzero="False" count="7" total="11.0" min="0" max="3" avg="1.57142857143" sup="0">
+                    <__diff__ nonzero="0" count="-1" avg="0.196428571429" min="-1" max="0" total="0.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="1" metric="0" ratio="0.142857142857" />
                         <distribution-bar count="3" __diff__="-3" metric="1" ratio="0.428571428571" />
                         <distribution-bar count="1" __diff__="0" metric="2" ratio="0.142857142857" />
                         <distribution-bar count="2" __diff__="1" metric="3" ratio="0.285714285714" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-1" avg="0.196428571429" min="-1" max="0" total="0.0" />
                 </cyclomatic>
             </std.code.complexity>
         </aggregated-data>

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_per_file_stdout.gold.txt

@@ -103,17 +103,18 @@
         <aggregated-data>
             <std.code.complexity>
                 <cyclomatic nonzero="False" count="6" total="8.0" min="0" max="3" avg="1.33333333333" sup="0">
+                    <__diff__ nonzero="0" count="0" avg="-0.166666666667" min="-1" max="0" total="-1.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="1" metric="0" ratio="0.166666666667" />
                         <distribution-bar count="3" __diff__="-1" metric="1" ratio="0.5" />
                         <distribution-bar count="1" __diff__="0" metric="2" ratio="0.166666666667" />
                         <distribution-bar count="1" __diff__="0" metric="3" ratio="0.166666666667" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="0" avg="-0.166666666667" min="-1" max="0" total="-1.0" />
                 </cyclomatic>
             </std.code.complexity>
             <std.code.lines>
                 <total nonzero="False" count="10" total="56.0" min="0" max="12" avg="5.6" sup="0">
+                    <__diff__ nonzero="0" count="-1" avg="0.0545454545455" min="0" max="0" total="-5.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="0" metric="0" ratio="0.1" />
                         <distribution-bar count="1" __diff__="-1" metric="3" ratio="0.1" />
@@ -125,9 +126,9 @@
                         <distribution-bar count="1" __diff__="1" metric="9" ratio="0.1" />
                         <distribution-bar count="1" __diff__="0" metric="12" ratio="0.1" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-1" avg="0.0545454545455" min="0" max="0" total="-5.0" />
                 </total>
                 <code nonzero="False" count="10" total="50.0" min="0" max="11" avg="5.0" sup="0">
+                    <__diff__ nonzero="0" count="-1" avg="-0.0909090909091" min="0" max="0" total="-6.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="0" metric="0" ratio="0.1" />
                         <distribution-bar count="2" __diff__="0" metric="3" ratio="0.2" />
@@ -137,23 +138,22 @@
                         <distribution-bar count="1" __diff__="1" metric="8" ratio="0.1" />
                         <distribution-bar count="1" __diff__="0" metric="11" ratio="0.1" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-1" avg="-0.0909090909091" min="0" max="0" total="-6.0" />
                 </code>
                 <preprocessor nonzero="False" count="10" total="2.0" min="0" max="2" avg="0.2" sup="0">
+                    <__diff__ nonzero="0" count="-1" avg="0.109090909091" min="0" max="1" total="1.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="9" __diff__="-1" metric="0" ratio="0.9" />
                         <distribution-bar count="0" __diff__="-1" metric="1" ratio="0" />
                         <distribution-bar count="1" __diff__="1" metric="2" ratio="0.1" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-1" avg="0.109090909091" min="0" max="1" total="1.0" />
                 </preprocessor>
                 <comments nonzero="False" count="10" total="7.0" min="0" max="2" avg="0.7" sup="0">
+                    <__diff__ nonzero="0" count="-1" avg="0.245454545455" min="0" max="0" total="2.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="5" __diff__="-2" metric="0" ratio="0.5" />
                         <distribution-bar count="3" __diff__="0" metric="1" ratio="0.3" />
                         <distribution-bar count="2" __diff__="1" metric="2" ratio="0.2" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-1" avg="0.245454545455" min="0" max="0" total="2.0" />
                 </comments>
             </std.code.lines>
         </aggregated-data>

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_per_file_txt_all_stdout.gold.txt

@@ -109,7 +109,7 @@
 	Minimum        : 0 [-1]
 	Maximum        : 3 [+0]
 	Total          : 8.0 [-1.0]
-	Distribution   : 6 [+0] regions in total (including 0 suppressed)
+	Distribution   : 6 [+0] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.167 : 0.167 : 1 [+1]	|||||||||||||||||
 	             1 : 0.500 : 0.667 : 3 [-1]	||||||||||||||||||||||||||||||||||||||||||||||||||
@@ -121,7 +121,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 12 [+0]
 	Total          : 56.0 [-5.0]
-	Distribution   : 10 [-1] regions in total (including 0 suppressed)
+	Distribution   : 10 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.100 : 0.100 :  1 [+0 ]	||||||||||
 	             3 : 0.100 : 0.200 :  1 [-1 ]	||||||||||
@@ -138,7 +138,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 11 [+0]
 	Total          : 50.0 [-6.0]
-	Distribution   : 10 [-1] regions in total (including 0 suppressed)
+	Distribution   : 10 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.100 : 0.100 :  1 [+0 ]	||||||||||
 	             3 : 0.200 : 0.300 :  2 [+0 ]	||||||||||||||||||||
@@ -153,7 +153,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+1]
 	Total          : 2.0 [+1.0]
-	Distribution   : 10 [-1] regions in total (including 0 suppressed)
+	Distribution   : 10 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.900 : 0.900 :  9 [-1 ]	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.000 : 0.900 :  0 [-1 ]	
@@ -164,7 +164,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+0]
 	Total          : 7.0 [+2.0]
-	Distribution   : 10 [-1] regions in total (including 0 suppressed)
+	Distribution   : 10 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.500 : 0.500 :  5 [-2 ]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.300 : 0.800 :  3 [+0 ]	||||||||||||||||||||||||||||||

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_per_file_txt_new_stdout.gold.txt

@@ -109,7 +109,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 1 [+1]
 	Total          : 1.0 [+1.0]
-	Distribution   : 2 [+2] regions in total (including 0 suppressed)
+	Distribution   : 2 [+2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.500 : 0.500 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.500 : 1.000 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
@@ -119,7 +119,7 @@
 	Minimum        : 4 [+4]
 	Maximum        : 5 [+5]
 	Total          : 9.0 [+9.0]
-	Distribution   : 2 [+2] regions in total (including 0 suppressed)
+	Distribution   : 2 [+2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             4 : 0.500 : 0.500 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             5 : 0.500 : 1.000 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
@@ -129,7 +129,7 @@
 	Minimum        : 3 [+3]
 	Maximum        : 5 [+5]
 	Total          : 8.0 [+8.0]
-	Distribution   : 2 [+2] regions in total (including 0 suppressed)
+	Distribution   : 2 [+2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             3 : 0.500 : 0.500 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             5 : 0.500 : 1.000 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
@@ -139,7 +139,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 0 [+0]
 	Total          : 0.0 [+0.0]
-	Distribution   : 2 [+2] regions in total (including 0 suppressed)
+	Distribution   : 2 [+2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 1.000 : 1.000 : 2 [+2]	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
@@ -148,7 +148,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 1 [+1]
 	Total          : 1.0 [+1.0]
-	Distribution   : 2 [+2] regions in total (including 0 suppressed)
+	Distribution   : 2 [+2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.500 : 0.500 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.500 : 1.000 : 1 [+1]	||||||||||||||||||||||||||||||||||||||||||||||||||

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_per_file_txt_touched_stdout.gold.txt

@@ -109,7 +109,7 @@
 	Minimum        : 0 [-1]
 	Maximum        : 2 [+0]
 	Total          : 4.0 [-1.0]
-	Distribution   : 4 [+0] regions in total (including 0 suppressed)
+	Distribution   : 4 [+0] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.250 : 0.250 : 1 [+1]	|||||||||||||||||||||||||
 	             1 : 0.500 : 0.750 : 2 [-1]	||||||||||||||||||||||||||||||||||||||||||||||||||
@@ -120,7 +120,7 @@
 	Minimum        : 4 [+1]
 	Maximum        : 9 [+1]
 	Total          : 36.0 [-5.0]
-	Distribution   : 6 [-1] regions in total (including 0 suppressed)
+	Distribution   : 6 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             3 : 0.000 : 0.000 : 0 [-1]	
 	             4 : 0.333 : 0.333 : 2 [+1]	|||||||||||||||||||||||||||||||||
@@ -135,7 +135,7 @@
 	Minimum        : 3 [+0]
 	Maximum        : 8 [+1]
 	Total          : 31.0 [-6.0]
-	Distribution   : 6 [-1] regions in total (including 0 suppressed)
+	Distribution   : 6 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             3 : 0.167 : 0.167 : 1 [+0]	|||||||||||||||||
 	             4 : 0.333 : 0.500 : 2 [+0]	|||||||||||||||||||||||||||||||||
@@ -148,7 +148,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+1]
 	Total          : 2.0 [+1.0]
-	Distribution   : 6 [-1] regions in total (including 0 suppressed)
+	Distribution   : 6 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.833 : 0.833 : 5 [-1]	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.000 : 0.833 : 0 [-1]	
@@ -159,7 +159,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+1]
 	Total          : 5.0 [+2.0]
-	Distribution   : 6 [-1] regions in total (including 0 suppressed)
+	Distribution   : 6 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.333 : 0.333 : 2 [-2]	|||||||||||||||||||||||||||||||||
 	             1 : 0.500 : 0.833 : 3 [+0]	||||||||||||||||||||||||||||||||||||||||||||||||||

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_stdout.gold.txt

@@ -11,17 +11,18 @@
         <aggregated-data>
             <std.code.complexity>
                 <cyclomatic nonzero="False" count="7" total="11.0" min="0" max="3" avg="1.57142857143" sup="0">
+                    <__diff__ nonzero="0" count="-1" avg="0.196428571429" min="-1" max="0" total="0.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="1" __diff__="1" metric="0" ratio="0.142857142857" />
                         <distribution-bar count="3" __diff__="-3" metric="1" ratio="0.428571428571" />
                         <distribution-bar count="1" __diff__="0" metric="2" ratio="0.142857142857" />
                         <distribution-bar count="2" __diff__="1" metric="3" ratio="0.285714285714" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-1" avg="0.196428571429" min="-1" max="0" total="0.0" />
                 </cyclomatic>
             </std.code.complexity>
             <std.code.lines>
                 <total nonzero="False" count="14" total="76.0" min="0" max="12" avg="5.42857142857" sup="0">
+                    <__diff__ nonzero="0" count="-2" avg="-0.00892857142857" min="0" max="0" total="-11.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="2" __diff__="0" metric="0" ratio="0.142857142857" />
                         <distribution-bar count="2" __diff__="-1" metric="3" ratio="0.142857142857" />
@@ -33,9 +34,9 @@
                         <distribution-bar count="1" __diff__="0" metric="9" ratio="0.0714285714286" />
                         <distribution-bar count="2" __diff__="1" metric="12" ratio="0.142857142857" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-2" avg="-0.00892857142857" min="0" max="0" total="-11.0" />
                 </total>
                 <code nonzero="False" count="14" total="67.0" min="0" max="11" avg="4.78571428571" sup="0">
+                    <__diff__ nonzero="0" count="-2" avg="-0.0892857142857" min="0" max="0" total="-11.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="2" __diff__="0" metric="0" ratio="0.142857142857" />
                         <distribution-bar count="3" __diff__="0" metric="3" ratio="0.214285714286" />
@@ -46,23 +47,22 @@
                         <distribution-bar count="1" __diff__="1" metric="10" ratio="0.0714285714286" />
                         <distribution-bar count="1" __diff__="0" metric="11" ratio="0.0714285714286" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-2" avg="-0.0892857142857" min="0" max="0" total="-11.0" />
                 </code>
                 <preprocessor nonzero="False" count="14" total="2.0" min="0" max="2" avg="0.142857142857" sup="0">
+                    <__diff__ nonzero="0" count="-2" avg="0.0803571428571" min="0" max="1" total="1.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="13" __diff__="-2" metric="0" ratio="0.928571428571" />
                         <distribution-bar count="0" __diff__="-1" metric="1" ratio="0" />
                         <distribution-bar count="1" __diff__="1" metric="2" ratio="0.0714285714286" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-2" avg="0.0803571428571" min="0" max="1" total="1.0" />
                 </preprocessor>
                 <comments nonzero="False" count="14" total="10.0" min="0" max="2" avg="0.714285714286" sup="0">
+                    <__diff__ nonzero="0" count="-2" avg="0.0892857142857" min="0" max="-1" total="0.0" sup="0" />
                     <distribution-bars>
                         <distribution-bar count="7" __diff__="-3" metric="0" ratio="0.5" />
                         <distribution-bar count="4" __diff__="1" metric="1" ratio="0.285714285714" />
                         <distribution-bar count="3" __diff__="1" metric="2" ratio="0.214285714286" />
                     </distribution-bars>
-                    <__diff__ nonzero="0" count="-2" avg="0.0892857142857" min="0" max="-1" total="0.0" />
                 </comments>
             </std.code.lines>
         </aggregated-data>

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_txt_all_stdout.gold.txt

@@ -3,7 +3,7 @@
 	Minimum        : 0 [-1]
 	Maximum        : 3 [+0]
 	Total          : 11.0 [+0.0]
-	Distribution   : 7 [-1] regions in total (including 0 suppressed)
+	Distribution   : 7 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.143 : 0.143 : 1 [+1]	||||||||||||||
 	             1 : 0.429 : 0.571 : 3 [-3]	|||||||||||||||||||||||||||||||||||||||||||
@@ -15,7 +15,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 12 [+0]
 	Total          : 76.0 [-11.0]
-	Distribution   : 14 [-2] regions in total (including 0 suppressed)
+	Distribution   : 14 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.143 : 0.143 :  2 [+0 ]	||||||||||||||
 	             3 : 0.143 : 0.286 :  2 [-1 ]	||||||||||||||
@@ -32,7 +32,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 11 [+0]
 	Total          : 67.0 [-11.0]
-	Distribution   : 14 [-2] regions in total (including 0 suppressed)
+	Distribution   : 14 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.143 : 0.143 :  2 [+0 ]	||||||||||||||
 	             3 : 0.214 : 0.357 :  3 [+0 ]	|||||||||||||||||||||
@@ -48,7 +48,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+1]
 	Total          : 2.0 [+1.0]
-	Distribution   : 14 [-2] regions in total (including 0 suppressed)
+	Distribution   : 14 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.929 : 0.929 : 13 [-2 ]	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.000 : 0.929 :  0 [-1 ]	
@@ -59,7 +59,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [-1]
 	Total          : 10.0 [+0.0]
-	Distribution   : 14 [-2] regions in total (including 0 suppressed)
+	Distribution   : 14 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.500 : 0.500 :  7 [-3 ]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.286 : 0.786 :  4 [+1 ]	|||||||||||||||||||||||||||||

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_txt_new_stdout.gold.txt

@@ -3,7 +3,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 3 [+3]
 	Total          : 4.0 [+4.0]
-	Distribution   : 3 [+3] regions in total (including 0 suppressed)
+	Distribution   : 3 [+3] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.333 : 0.333 : 1 [+1]	|||||||||||||||||||||||||||||||||
 	             1 : 0.333 : 0.667 : 1 [+1]	|||||||||||||||||||||||||||||||||
@@ -14,7 +14,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 12 [+12]
 	Total          : 29.0 [+29.0]
-	Distribution   : 6 [+6] regions in total (including 0 suppressed)
+	Distribution   : 6 [+6] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.167 : 0.167 : 1 [+1]	|||||||||||||||||
 	             3 : 0.167 : 0.333 : 1 [+1]	|||||||||||||||||
@@ -27,7 +27,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 10 [+10]
 	Total          : 25.0 [+25.0]
-	Distribution   : 6 [+6] regions in total (including 0 suppressed)
+	Distribution   : 6 [+6] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.167 : 0.167 : 1 [+1]	|||||||||||||||||
 	             3 : 0.333 : 0.500 : 2 [+2]	|||||||||||||||||||||||||||||||||
@@ -40,7 +40,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 0 [+0]
 	Total          : 0.0 [+0.0]
-	Distribution   : 6 [+6] regions in total (including 0 suppressed)
+	Distribution   : 6 [+6] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 1.000 : 1.000 : 6 [+6]	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
@@ -49,7 +49,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+2]
 	Total          : 4.0 [+4.0]
-	Distribution   : 6 [+6] regions in total (including 0 suppressed)
+	Distribution   : 6 [+6] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.500 : 0.500 : 3 [+3]	||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.333 : 0.833 : 2 [+2]	|||||||||||||||||||||||||||||||||

+ 5 - 5
mainline/tests/general/test_basic/test_workflow_view_second_txt_touched_stdout.gold.txt

@@ -3,7 +3,7 @@
 	Minimum        : 0 [-1]
 	Maximum        : 3 [+1]
 	Total          : 7.0 [+0.0]
-	Distribution   : 5 [-1] regions in total (including 0 suppressed)
+	Distribution   : 5 [-1] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.200 : 0.200 : 1 [+1]	||||||||||||||||||||
 	             1 : 0.400 : 0.600 : 2 [-3]	||||||||||||||||||||||||||||||||||||||||
@@ -15,7 +15,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 12 [+3]
 	Total          : 56.0 [-11.0]
-	Distribution   : 10 [-2] regions in total (including 0 suppressed)
+	Distribution   : 10 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.100 : 0.100 :  1 [+0 ]	||||||||||
 	             3 : 0.100 : 0.200 :  1 [-1 ]	||||||||||
@@ -32,7 +32,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 10 [+2]
 	Total          : 48.0 [-11.0]
-	Distribution   : 10 [-2] regions in total (including 0 suppressed)
+	Distribution   : 10 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.100 : 0.100 :  1 [+0 ]	||||||||||
 	             3 : 0.200 : 0.300 :  2 [+0 ]	||||||||||||||||||||
@@ -47,7 +47,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [+1]
 	Total          : 2.0 [+1.0]
-	Distribution   : 10 [-2] regions in total (including 0 suppressed)
+	Distribution   : 10 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.900 : 0.900 :  9 [-2 ]	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.000 : 0.900 :  0 [-1 ]	
@@ -58,7 +58,7 @@
 	Minimum        : 0 [+0]
 	Maximum        : 2 [-1]
 	Total          : 8.0 [+0.0]
-	Distribution   : 10 [-2] regions in total (including 0 suppressed)
+	Distribution   : 10 [-2] regions in total (including 0 [+0] suppressed)
 	  Metric value : Ratio : R-sum : Number of regions
 	             0 : 0.400 : 0.400 :  4 [-3 ]	||||||||||||||||||||||||||||||||||||||||
 	             1 : 0.400 : 0.800 :  4 [+1 ]	||||||||||||||||||||||||||||||||||||||||

+ 3 - 0
mainline/tests/general/test_std_suppress.py

@@ -32,6 +32,9 @@ class Test(tests.common.TestCase):
                                                      '--std.general.size'])
         self.assertExec(runner.run())
 
+        runner = tests.common.ToolRunner('view')
+        self.assertExec(runner.run())
+
         runner = tests.common.ToolRunner('limit',
                                          ['--max-limit=std.code.complexity:cyclomatic:0'],
                                          exit_code=1,

+ 66 - 0
mainline/tests/general/test_std_suppress/test_basic_view_default_stdout.gold.txt

@@ -0,0 +1,66 @@
+:: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
+	Average        : 0.470588235294
+	Minimum        : 0
+	Maximum        : 1
+	Total          : 8.0
+	Distribution   : 17 regions in total (including 7 suppressed)
+	  Metric value : Ratio : R-sum : Number of regions
+	             0 : 0.529 : 0.529 :  9	|||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.471 : 1.000 :  8	|||||||||||||||||||||||||||||||||||||||||||||||
+
+:: info: Overall metrics for 'std.general:size' metric
+	Average        : 3016.0
+	Minimum        : 3016
+	Maximum        : 3016
+	Total          : 3016.0
+	Distribution   : 1 files in total (including 0 suppressed)
+	  Metric value : Ratio : R-sum : Number of files
+	          3016 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+:: info: Overall metrics for 'std.suppress.file:count' metric
+	Average        : 1.0 (excluding zero metric values)
+	Minimum        : 1
+	Maximum        : 1
+	Total          : 1.0
+	Distribution   : 1 files in total (including 0 suppressed)
+	  Metric value : Ratio : R-sum : Number of files
+	             1 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+:: info: Overall metrics for 'std.suppress:count' metric
+	Average        : 1.2380952381 (excluding zero metric values)
+	Minimum        : 1
+	Maximum        : 2
+	Total          : 26.0
+	Distribution   : 21 regions in total (including 0 suppressed)
+	  Metric value : Ratio : R-sum : Number of regions
+	             1 : 0.762 : 0.762 : 16	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             2 : 0.238 : 1.000 :  5	||||||||||||||||||||||||
+
+:: info: Overall metrics for 'std.code.length:total' metric
+	Average        : 116.0
+	Minimum        : 43
+	Maximum        : 242
+	Total          : 3016.0
+	Distribution   : 26 regions in total (including 19 suppressed)
+	  Metric value : Ratio : R-sum : Number of regions
+	         43-53 : 0.115 : 0.115 :  3	||||||||||||
+	         53-63 : 0.115 : 0.231 :  3	||||||||||||
+	         63-73 : 0.038 : 0.269 :  1	||||
+	         73-83 : 0.192 : 0.462 :  5	|||||||||||||||||||
+	         83-93 : 0.038 : 0.500 :  1	||||
+	        93-103 : 0.038 : 0.538 :  1	||||
+	       103-113 : 0.038 : 0.577 :  1	||||
+	       113-123 : 0.038 : 0.615 :  1	||||
+	       123-133 : 0.077 : 0.692 :  2	||||||||
+	       133-143 : 0.077 : 0.769 :  2	||||||||
+	       143-153 : 0.038 : 0.808 :  1	||||
+	       153-163 : 0.038 : 0.846 :  1	||||
+	       163-173 : 0.038 : 0.885 :  1	||||
+	       173-183 : 0.038 : 0.923 :  1	||||
+	       183-193 : 0.038 : 0.962 :  1	||||
+	       193-242 : 0.038 : 1.000 :  1	||||
+
+:: info: Directory content:
+	Directory      : .
+
+