Browse Source

new format for text view.py

avkonst 11 years ago
parent
commit
54b107eadf

+ 16 - 9
mainline/ext/std/tools/view.py

@@ -52,9 +52,7 @@ class Plugin(mpp.api.Plugin, mpp.api.IConfigurable, mpp.api.IRunable):
 def export_to_str(out_format, paths, loader, loader_prev, nest_regions):
     exit_code = 0
     result = ""
-    if out_format == 'txt':
-        result += "=" * 80 + "\n" + "Export" + "\n" + "_" * 80 + "\n\n"
-    elif out_format == 'xml':
+    if out_format == 'xml':
         result += "<export>\n"
     elif out_format == 'python':
         result += "{'export': ["
@@ -92,8 +90,7 @@ def export_to_str(out_format, paths, loader, loader_prev, nest_regions):
                 "subfiles": subfiles}
 
         if out_format == 'txt':
-            result += mpp.utils.serialize_to_txt(data, root_name = "data") + "\n"
-            #cout_txt(data)
+            cout_txt(data)
         elif out_format == 'xml':
             result += mpp.utils.serialize_to_xml(data, root_name = "data") + "\n"
         elif out_format == 'python':
@@ -102,9 +99,7 @@ def export_to_str(out_format, paths, loader, loader_prev, nest_regions):
                 postfix = ", "
             result += mpp.utils.serialize_to_python(data, root_name = "data") + postfix
 
-    if out_format == 'txt':
-        result += "\n"
-    elif out_format == 'xml':
+    if out_format == 'xml':
         result += "</export>"
     elif out_format == 'python':
         result += "]}"
@@ -304,4 +299,16 @@ def cout_txt(data):
                     '', # no line number
                     mpp.cout.SEVERITY_INFO,
                     "Overall metrics for '" + namespace + ":" + field + "' metric",
-                    details)
+                    details)
+    details = []
+    for each in data['subdirs']:
+        details.append(('Directory', each))
+    for each in data['subfiles']:
+        details.append(('File', each))
+    if len(details) > 0: 
+        mpp.cout.notify(data['info']['path'],
+                '', # no line number
+                mpp.cout.SEVERITY_INFO,
+                "Directory content:",
+                details)
+    

+ 76 - 145
mainline/tests/general/test_basic/test_std_general_metrics_view_nest_per_file_stdout.gold.txt

@@ -1,148 +1,79 @@
-================================================================================
-Export
-________________________________________________________________________________
+./simple.cpp:0: info: Metrics per '__global__' region
+	Region name    : __global__
+	Region type    : global
+	Offsets        : 0-487
+	Line numbers   : 1-52
 
---------------------------------------------------------------------------------
-data:  
-.   info: 
-.   .   path="./simple.cpp"
-.   .   id="1"
-.   file-data:  
-.   .   regions:
-.   .   
-.   .   .   region:  
-.   .   .   .   info: 
-.   .   .   .   .   cursor="0"
-.   .   .   .   .   name="__global__"
-.   .   .   .   .   offset_end="487"
-.   .   .   .   .   line_begin="1"
-.   .   .   .   .   type="global"
-.   .   .   .   .   line_end="52"
-.   .   .   .   .   offset_begin="0"
-.   .   .   .   data: 
-.   .   .   .   subregions:
-.   .   .   .   
-.   .   .   .   .   subregion:  
-.   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   cursor="4"
-.   .   .   .   .   .   .   name="hmm"
-.   .   .   .   .   .   .   offset_end="486"
-.   .   .   .   .   .   .   line_begin="3"
-.   .   .   .   .   .   .   type="namespace"
-.   .   .   .   .   .   .   line_end="51"
-.   .   .   .   .   .   .   offset_begin="2"
-.   .   .   .   .   .   data: 
-.   .   .   .   .   .   subregions:
-.   .   .   .   .   .   
-.   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   cursor="7"
-.   .   .   .   .   .   .   .   .   name="A"
-.   .   .   .   .   .   .   .   .   offset_end="482"
-.   .   .   .   .   .   .   .   .   line_begin="7"
-.   .   .   .   .   .   .   .   .   type="class"
-.   .   .   .   .   .   .   .   .   line_end="49"
-.   .   .   .   .   .   .   .   .   offset_begin="76"
-.   .   .   .   .   .   .   .   data: 
-.   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   cursor="10"
-.   .   .   .   .   .   .   .   .   .   .   name="A"
-.   .   .   .   .   .   .   .   .   .   .   offset_end="234"
-.   .   .   .   .   .   .   .   .   .   .   line_begin="10"
-.   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   line_end="21"
-.   .   .   .   .   .   .   .   .   .   .   offset_begin="88"
-.   .   .   .   .   .   .   .   .   .   data: 
-.   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   cursor="23"
-.   .   .   .   .   .   .   .   .   .   .   name="func"
-.   .   .   .   .   .   .   .   .   .   .   offset_end="386"
-.   .   .   .   .   .   .   .   .   .   .   line_begin="23"
-.   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   line_end="37"
-.   .   .   .   .   .   .   .   .   .   .   offset_begin="237"
-.   .   .   .   .   .   .   .   .   .   data: 
-.   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   cursor="25"
-.   .   .   .   .   .   .   .   .   .   .   .   .   name="embeded"
-.   .   .   .   .   .   .   .   .   .   .   .   .   offset_end="372"
-.   .   .   .   .   .   .   .   .   .   .   .   .   line_begin="25"
-.   .   .   .   .   .   .   .   .   .   .   .   .   type="class"
-.   .   .   .   .   .   .   .   .   .   .   .   .   line_end="35"
-.   .   .   .   .   .   .   .   .   .   .   .   .   offset_begin="266"
-.   .   .   .   .   .   .   .   .   .   .   .   data: 
-.   .   .   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   cursor="27"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   name="embeded"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   offset_end="368"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   line_begin="27"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   line_end="34"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   offset_begin="287"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   data: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   cursor="39"
-.   .   .   .   .   .   .   .   .   .   .   name="never"
-.   .   .   .   .   .   .   .   .   .   .   offset_end="459"
-.   .   .   .   .   .   .   .   .   .   .   line_begin="39"
-.   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   line_end="46"
-.   .   .   .   .   .   .   .   .   .   .   offset_begin="389"
-.   .   .   .   .   .   .   .   .   .   data: 
-.   .   .   .   .   .   .   .   .   .   subregions:
-.   .   std.general: 
-.   .   .   proctime="0.01"
-.   .   .   size="487"
-.   subfiles:
-.   subdirs:
-.   aggregated-data:  
-.   .   std.general:  
-.   .   .   procerrors: 
-.   .   .   .   count="0"
-.   .   .   .   max="None"
-.   .   .   .   avg="None"
-.   .   .   .   total="0.0"
-.   .   .   .   min="None" 
-.   .   .   .   distribution-bars:
-.   .   .   proctime: 
-.   .   .   .   count="1"
-.   .   .   .   max="0.01"
-.   .   .   .   avg="0.01"
-.   .   .   .   total="0.01"
-.   .   .   .   min="0.01" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="0.01"
-.   .   .   .   .   .   ratio="1.0"
-.   .   .   size: 
-.   .   .   .   count="1"
-.   .   .   .   max="487"
-.   .   .   .   avg="487.0"
-.   .   .   .   total="487.0"
-.   .   .   .   min="487" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="487"
-.   .   .   .   .   .   ratio="1.0"
-================================================================================
+.   ./simple.cpp:4: info: Metrics per 'hmm' region
+    	Region name    : hmm
+    	Region type    : namespace
+    	Offsets        : 2-486
+    	Line numbers   : 3-51
+
+.   .   ./simple.cpp:7: info: Metrics per 'A' region
+        	Region name    : A
+        	Region type    : class
+        	Offsets        : 76-482
+        	Line numbers   : 7-49
+
+.   .   .   ./simple.cpp:10: info: Metrics per 'A' region
+            	Region name    : A
+            	Region type    : function
+            	Offsets        : 88-234
+            	Line numbers   : 10-21
+
+.   .   .   ./simple.cpp:23: info: Metrics per 'func' region
+            	Region name    : func
+            	Region type    : function
+            	Offsets        : 237-386
+            	Line numbers   : 23-37
+
+.   .   .   .   ./simple.cpp:25: info: Metrics per 'embeded' region
+                	Region name    : embeded
+                	Region type    : class
+                	Offsets        : 266-372
+                	Line numbers   : 25-35
+
+.   .   .   .   .   ./simple.cpp:27: info: Metrics per 'embeded' region
+                    	Region name    : embeded
+                    	Region type    : function
+                    	Offsets        : 287-368
+                    	Line numbers   : 27-34
+
+.   .   .   ./simple.cpp:39: info: Metrics per 'never' region
+            	Region name    : never
+            	Region type    : function
+            	Offsets        : 389-459
+            	Line numbers   : 39-46
+
+./simple.cpp:0: info: Metrics per file
+	std.general:proctime: 0.01
+	std.general:size: 487
+
+./simple.cpp:: info: Overall metrics for 'std.general:procerrors' metric
+	Average        : None
+	Minimum        : None
+	Maximum        : None
+	Total          : 0.0
+	Distribution   : 0 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+
+./simple.cpp:: info: Overall metrics for 'std.general:proctime' metric
+	Average        : 0.01
+	Minimum        : 0.01
+	Maximum        : 0.01
+	Total          : 0.01
+	Distribution   : 1 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	        0.0100 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+./simple.cpp:: info: Overall metrics for 'std.general:size' metric
+	Average        : 487.0
+	Minimum        : 487
+	Maximum        : 487
+	Total          : 487.0
+	Distribution   : 1 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	           487 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 

+ 27 - 46
mainline/tests/general/test_basic/test_std_general_metrics_view_txt_stdout.gold.txt

@@ -1,49 +1,30 @@
-================================================================================
-Export
-________________________________________________________________________________
+:: info: Overall metrics for 'std.general:procerrors' metric
+	Average        : None
+	Minimum        : None
+	Maximum        : None
+	Total          : 0.0
+	Distribution   : 0 files/regions measured
+	  Metric value : Ratio : Number of files/regions
 
---------------------------------------------------------------------------------
-data:  
-.   info: 
-.   .   path=""
-.   .   id="1"
-.   file-data: 
-.   subfiles:
-.   subdirs:
-.   .   .
-.   aggregated-data:  
-.   .   std.general:  
-.   .   .   procerrors: 
-.   .   .   .   count="0"
-.   .   .   .   max="None"
-.   .   .   .   avg="None"
-.   .   .   .   total="0.0"
-.   .   .   .   min="None" 
-.   .   .   .   distribution-bars:
-.   .   .   proctime: 
-.   .   .   .   count="1"
-.   .   .   .   max="0.01"
-.   .   .   .   avg="0.01"
-.   .   .   .   total="0.01"
-.   .   .   .   min="0.01" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="0.01"
-.   .   .   .   .   .   ratio="1.0"
-.   .   .   size: 
-.   .   .   .   count="1"
-.   .   .   .   max="487"
-.   .   .   .   avg="487.0"
-.   .   .   .   total="487.0"
-.   .   .   .   min="487" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="487"
-.   .   .   .   .   .   ratio="1.0"
-================================================================================
+:: info: Overall metrics for 'std.general:proctime' metric
+	Average        : 0.01
+	Minimum        : 0.01
+	Maximum        : 0.01
+	Total          : 0.01
+	Distribution   : 1 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	        0.0100 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+:: info: Overall metrics for 'std.general:size' metric
+	Average        : 487.0
+	Minimum        : 487
+	Maximum        : 487
+	Total          : 487.0
+	Distribution   : 1 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	           487 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+:: info: Directory content:
+	Directory      : .
 
 

+ 127 - 264
mainline/tests/general/test_basic/test_std_lines_metrics_view_nest_per_file_stdout.gold.txt

@@ -1,267 +1,130 @@
-================================================================================
-Export
-________________________________________________________________________________
+./simple.cpp:0: info: Metrics per '__global__' region
+	Region name    : __global__
+	Region type    : global
+	Offsets        : 0-487
+	Line numbers   : 1-52
+	std.code.lines:code: 0
+	std.code.lines:total: 0
+	std.code.lines:preprocessor: 0
+	std.code.lines:comments: 0
 
---------------------------------------------------------------------------------
-data:  
-.   info: 
-.   .   path="./simple.cpp"
-.   .   id="1"
-.   file-data:  
-.   .   regions:
-.   .   
-.   .   .   region:  
-.   .   .   .   info: 
-.   .   .   .   .   cursor="0"
-.   .   .   .   .   name="__global__"
-.   .   .   .   .   offset_end="487"
-.   .   .   .   .   line_begin="1"
-.   .   .   .   .   type="global"
-.   .   .   .   .   line_end="52"
-.   .   .   .   .   offset_begin="0"
-.   .   .   .   data:  
-.   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   total="0"
-.   .   .   .   .   .   code="0"
-.   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   comments="0"
-.   .   .   .   subregions:
-.   .   .   .   
-.   .   .   .   .   subregion:  
-.   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   cursor="4"
-.   .   .   .   .   .   .   name="hmm"
-.   .   .   .   .   .   .   offset_end="486"
-.   .   .   .   .   .   .   line_begin="3"
-.   .   .   .   .   .   .   type="namespace"
-.   .   .   .   .   .   .   line_end="51"
-.   .   .   .   .   .   .   offset_begin="2"
-.   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   total="5"
-.   .   .   .   .   .   .   .   code="4"
-.   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   comments="1"
-.   .   .   .   .   .   subregions:
-.   .   .   .   .   .   
-.   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   cursor="7"
-.   .   .   .   .   .   .   .   .   name="A"
-.   .   .   .   .   .   .   .   .   offset_end="482"
-.   .   .   .   .   .   .   .   .   line_begin="7"
-.   .   .   .   .   .   .   .   .   type="class"
-.   .   .   .   .   .   .   .   .   line_end="49"
-.   .   .   .   .   .   .   .   .   offset_begin="76"
-.   .   .   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   .   .   total="4"
-.   .   .   .   .   .   .   .   .   .   code="4"
-.   .   .   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   .   .   comments="0"
-.   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   cursor="10"
-.   .   .   .   .   .   .   .   .   .   .   name="A"
-.   .   .   .   .   .   .   .   .   .   .   offset_end="234"
-.   .   .   .   .   .   .   .   .   .   .   line_begin="10"
-.   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   line_end="21"
-.   .   .   .   .   .   .   .   .   .   .   offset_begin="88"
-.   .   .   .   .   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   .   .   .   .   total="12"
-.   .   .   .   .   .   .   .   .   .   .   .   code="11"
-.   .   .   .   .   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   .   .   .   .   comments="2"
-.   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   cursor="23"
-.   .   .   .   .   .   .   .   .   .   .   name="func"
-.   .   .   .   .   .   .   .   .   .   .   offset_end="386"
-.   .   .   .   .   .   .   .   .   .   .   line_begin="23"
-.   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   line_end="37"
-.   .   .   .   .   .   .   .   .   .   .   offset_begin="237"
-.   .   .   .   .   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   .   .   .   .   total="5"
-.   .   .   .   .   .   .   .   .   .   .   .   code="5"
-.   .   .   .   .   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   .   .   .   .   comments="0"
-.   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   cursor="25"
-.   .   .   .   .   .   .   .   .   .   .   .   .   name="embeded"
-.   .   .   .   .   .   .   .   .   .   .   .   .   offset_end="372"
-.   .   .   .   .   .   .   .   .   .   .   .   .   line_begin="25"
-.   .   .   .   .   .   .   .   .   .   .   .   .   type="class"
-.   .   .   .   .   .   .   .   .   .   .   .   .   line_end="35"
-.   .   .   .   .   .   .   .   .   .   .   .   .   offset_begin="266"
-.   .   .   .   .   .   .   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   total="3"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   code="3"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   comments="0"
-.   .   .   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   cursor="27"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   name="embeded"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   offset_end="368"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   line_begin="27"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   line_end="34"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   offset_begin="287"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   total="8"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   code="7"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   .   .   comments="1"
-.   .   .   .   .   .   .   .   .   .   .   .   .   .   subregions:
-.   .   .   .   .   .   .   .   
-.   .   .   .   .   .   .   .   .   subregion:  
-.   .   .   .   .   .   .   .   .   .   info: 
-.   .   .   .   .   .   .   .   .   .   .   cursor="39"
-.   .   .   .   .   .   .   .   .   .   .   name="never"
-.   .   .   .   .   .   .   .   .   .   .   offset_end="459"
-.   .   .   .   .   .   .   .   .   .   .   line_begin="39"
-.   .   .   .   .   .   .   .   .   .   .   type="function"
-.   .   .   .   .   .   .   .   .   .   .   line_end="46"
-.   .   .   .   .   .   .   .   .   .   .   offset_begin="389"
-.   .   .   .   .   .   .   .   .   .   data:  
-.   .   .   .   .   .   .   .   .   .   .   std.code.lines: 
-.   .   .   .   .   .   .   .   .   .   .   .   total="7"
-.   .   .   .   .   .   .   .   .   .   .   .   code="7"
-.   .   .   .   .   .   .   .   .   .   .   .   preprocessor="0"
-.   .   .   .   .   .   .   .   .   .   .   .   comments="0"
-.   .   .   .   .   .   .   .   .   .   subregions:
-.   subfiles:
-.   subdirs:
-.   aggregated-data:  
-.   .   std.code.lines:  
-.   .   .   total: 
-.   .   .   .   count="8"
-.   .   .   .   max="12"
-.   .   .   .   avg="5.5"
-.   .   .   .   total="44.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="3"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="4"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="5"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="7"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="8"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="12"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   code: 
-.   .   .   .   count="8"
-.   .   .   .   max="11"
-.   .   .   .   avg="5.125"
-.   .   .   .   total="41.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="3"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="4"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="5"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="7"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="11"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   preprocessor: 
-.   .   .   .   count="8"
-.   .   .   .   max="0"
-.   .   .   .   avg="0.0"
-.   .   .   .   total="0.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="8"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="1.0"
-.   .   .   comments: 
-.   .   .   .   count="8"
-.   .   .   .   max="2"
-.   .   .   .   avg="0.5"
-.   .   .   .   total="4.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="5"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="0.625"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="1"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="2"
-.   .   .   .   .   .   ratio="0.125"
-================================================================================
+.   ./simple.cpp:4: info: Metrics per 'hmm' region
+    	Region name    : hmm
+    	Region type    : namespace
+    	Offsets        : 2-486
+    	Line numbers   : 3-51
+    	std.code.lines:code: 4
+    	std.code.lines:total: 5
+    	std.code.lines:preprocessor: 0
+    	std.code.lines:comments: 1
+
+.   .   ./simple.cpp:7: info: Metrics per 'A' region
+        	Region name    : A
+        	Region type    : class
+        	Offsets        : 76-482
+        	Line numbers   : 7-49
+        	std.code.lines:code: 4
+        	std.code.lines:total: 4
+        	std.code.lines:preprocessor: 0
+        	std.code.lines:comments: 0
+
+.   .   .   ./simple.cpp:10: info: Metrics per 'A' region
+            	Region name    : A
+            	Region type    : function
+            	Offsets        : 88-234
+            	Line numbers   : 10-21
+            	std.code.lines:code: 11
+            	std.code.lines:total: 12
+            	std.code.lines:preprocessor: 0
+            	std.code.lines:comments: 2
+
+.   .   .   ./simple.cpp:23: info: Metrics per 'func' region
+            	Region name    : func
+            	Region type    : function
+            	Offsets        : 237-386
+            	Line numbers   : 23-37
+            	std.code.lines:code: 5
+            	std.code.lines:total: 5
+            	std.code.lines:preprocessor: 0
+            	std.code.lines:comments: 0
+
+.   .   .   .   ./simple.cpp:25: info: Metrics per 'embeded' region
+                	Region name    : embeded
+                	Region type    : class
+                	Offsets        : 266-372
+                	Line numbers   : 25-35
+                	std.code.lines:code: 3
+                	std.code.lines:total: 3
+                	std.code.lines:preprocessor: 0
+                	std.code.lines:comments: 0
+
+.   .   .   .   .   ./simple.cpp:27: info: Metrics per 'embeded' region
+                    	Region name    : embeded
+                    	Region type    : function
+                    	Offsets        : 287-368
+                    	Line numbers   : 27-34
+                    	std.code.lines:code: 7
+                    	std.code.lines:total: 8
+                    	std.code.lines:preprocessor: 0
+                    	std.code.lines:comments: 1
+
+.   .   .   ./simple.cpp:39: info: Metrics per 'never' region
+            	Region name    : never
+            	Region type    : function
+            	Offsets        : 389-459
+            	Line numbers   : 39-46
+            	std.code.lines:code: 7
+            	std.code.lines:total: 7
+            	std.code.lines:preprocessor: 0
+            	std.code.lines:comments: 0
+
+./simple.cpp:: info: Overall metrics for 'std.code.lines:total' metric
+	Average        : 5.5
+	Minimum        : 0
+	Maximum        : 12
+	Total          : 44.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 1	|||||||||||||
+	             4 : 0.125 : 1	|||||||||||||
+	             5 : 0.250 : 2	|||||||||||||||||||||||||
+	             7 : 0.125 : 1	|||||||||||||
+	             8 : 0.125 : 1	|||||||||||||
+	            12 : 0.125 : 1	|||||||||||||
+
+./simple.cpp:: info: Overall metrics for 'std.code.lines:code' metric
+	Average        : 5.125
+	Minimum        : 0
+	Maximum        : 11
+	Total          : 41.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 1	|||||||||||||
+	             4 : 0.250 : 2	|||||||||||||||||||||||||
+	             5 : 0.125 : 1	|||||||||||||
+	             7 : 0.250 : 2	|||||||||||||||||||||||||
+	            11 : 0.125 : 1	|||||||||||||
+
+./simple.cpp:: info: Overall metrics for 'std.code.lines:preprocessor' metric
+	Average        : 0.0
+	Minimum        : 0
+	Maximum        : 0
+	Total          : 0.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 1.000 : 8	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+./simple.cpp:: info: Overall metrics for 'std.code.lines:comments' metric
+	Average        : 0.5
+	Minimum        : 0
+	Maximum        : 2
+	Total          : 4.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 0.625 : 5	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.250 : 2	|||||||||||||||||||||||||
+	             2 : 0.125 : 1	|||||||||||||
 
 

+ 50 - 128
mainline/tests/general/test_basic/test_std_lines_metrics_view_txt_stdout.gold.txt

@@ -1,131 +1,53 @@
-================================================================================
-Export
-________________________________________________________________________________
+:: info: Overall metrics for 'std.code.lines:total' metric
+	Average        : 5.5
+	Minimum        : 0
+	Maximum        : 12
+	Total          : 44.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 1	|||||||||||||
+	             4 : 0.125 : 1	|||||||||||||
+	             5 : 0.250 : 2	|||||||||||||||||||||||||
+	             7 : 0.125 : 1	|||||||||||||
+	             8 : 0.125 : 1	|||||||||||||
+	            12 : 0.125 : 1	|||||||||||||
 
---------------------------------------------------------------------------------
-data:  
-.   info: 
-.   .   path=""
-.   .   id="1"
-.   file-data: 
-.   subfiles:
-.   subdirs:
-.   .   .
-.   aggregated-data:  
-.   .   std.code.lines:  
-.   .   .   total: 
-.   .   .   .   count="8"
-.   .   .   .   max="12"
-.   .   .   .   avg="5.5"
-.   .   .   .   total="44.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="3"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="4"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="5"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="7"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="8"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="12"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   code: 
-.   .   .   .   count="8"
-.   .   .   .   max="11"
-.   .   .   .   avg="5.125"
-.   .   .   .   total="41.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="3"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="4"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="5"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="7"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="11"
-.   .   .   .   .   .   ratio="0.125"
-.   .   .   preprocessor: 
-.   .   .   .   count="8"
-.   .   .   .   max="0"
-.   .   .   .   avg="0.0"
-.   .   .   .   total="0.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="8"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="1.0"
-.   .   .   comments: 
-.   .   .   .   count="8"
-.   .   .   .   max="2"
-.   .   .   .   avg="0.5"
-.   .   .   .   total="4.0"
-.   .   .   .   min="0" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="5"
-.   .   .   .   .   .   metric="0"
-.   .   .   .   .   .   ratio="0.625"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="2"
-.   .   .   .   .   .   metric="1"
-.   .   .   .   .   .   ratio="0.25"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="2"
-.   .   .   .   .   .   ratio="0.125"
-================================================================================
+:: info: Overall metrics for 'std.code.lines:code' metric
+	Average        : 5.125
+	Minimum        : 0
+	Maximum        : 11
+	Total          : 41.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 1	|||||||||||||
+	             4 : 0.250 : 2	|||||||||||||||||||||||||
+	             5 : 0.125 : 1	|||||||||||||
+	             7 : 0.250 : 2	|||||||||||||||||||||||||
+	            11 : 0.125 : 1	|||||||||||||
+
+:: info: Overall metrics for 'std.code.lines:preprocessor' metric
+	Average        : 0.0
+	Minimum        : 0
+	Maximum        : 0
+	Total          : 0.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 1.000 : 8	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+
+:: info: Overall metrics for 'std.code.lines:comments' metric
+	Average        : 0.5
+	Minimum        : 0
+	Maximum        : 2
+	Total          : 4.0
+	Distribution   : 8 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             0 : 0.625 : 5	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.250 : 2	|||||||||||||||||||||||||
+	             2 : 0.125 : 1	|||||||||||||
+
+:: info: Directory content:
+	Directory      : .
 
 

+ 11 - 32
mainline/tests/general/test_basic/test_view_format_view_txt_stdout.gold.txt

@@ -1,35 +1,14 @@
-================================================================================
-Export
-________________________________________________________________________________
+:: info: Overall metrics for 'std.code.complexity:cyclomatic' metric
+	Average        : 1.5
+	Minimum        : 1
+	Maximum        : 3
+	Total          : 6.0
+	Distribution   : 4 files/regions measured
+	  Metric value : Ratio : Number of files/regions
+	             1 : 0.750 : 3	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             3 : 0.250 : 1	|||||||||||||||||||||||||
 
---------------------------------------------------------------------------------
-data:  
-.   info: 
-.   .   path=""
-.   .   id="1"
-.   file-data: 
-.   subfiles:
-.   subdirs:
-.   .   .
-.   aggregated-data:  
-.   .   std.code.complexity:  
-.   .   .   cyclomatic: 
-.   .   .   .   count="4"
-.   .   .   .   max="3"
-.   .   .   .   avg="1.5"
-.   .   .   .   total="6.0"
-.   .   .   .   min="1" 
-.   .   .   .   distribution-bars:
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="3"
-.   .   .   .   .   .   metric="1"
-.   .   .   .   .   .   ratio="0.75"
-.   .   .   .   
-.   .   .   .   .   distribution-bar: 
-.   .   .   .   .   .   count="1"
-.   .   .   .   .   .   metric="3"
-.   .   .   .   .   .   ratio="0.25"
-================================================================================
+:: info: Directory content:
+	Directory      : .
 
 

File diff suppressed because it is too large
+ 780 - 1513
mainline/tests/general/test_std_code_cpp/test_parser_view_files_stdout.gold.txt


File diff suppressed because it is too large
+ 404 - 859
mainline/tests/general/test_std_code_cs/test_parser_view_files_stdout.gold.txt


File diff suppressed because it is too large
+ 945 - 1953
mainline/tests/general/test_std_code_java/test_parser_view_files_stdout.gold.txt