Pārlūkot izejas kodu

Fix for java attributes. Minor improvements.

avkonst 12 gadi atpakaļ
vecāks
revīzija
ef49ff8f37
30 mainītis faili ar 295 papildinājumiem un 44 dzēšanām
  1. 9 4
      mainline/core/dir.py
  2. 3 6
      mainline/core/loader.py
  3. 0 2
      mainline/ext/std/code/cpp.py
  4. 1 1
      mainline/ext/std/code/java.ini
  5. 3 2
      mainline/ext/std/code/java.py
  6. 75 0
      mainline/metrixpp.py
  7. 4 4
      mainline/tests/general/test_basic.py
  8. 1 1
      mainline/tests/general/test_basic/test_workflow_collect_default_stderr.gold.txt
  9. 1 1
      mainline/tests/general/test_basic/test_workflow_collect_second_stderr.gold.txt
  10. 1 1
      mainline/tests/general/test_basic/test_workflow_export_default_stderr.gold.txt
  11. 1 1
      mainline/tests/general/test_basic/test_workflow_export_second_per_file_stderr.gold.txt
  12. 1 1
      mainline/tests/general/test_basic/test_workflow_export_second_stderr.gold.txt
  13. 1 1
      mainline/tests/general/test_basic/test_workflow_info_default_stderr.gold.txt
  14. 1 1
      mainline/tests/general/test_basic/test_workflow_info_default_stdout.gold.txt
  15. 1 1
      mainline/tests/general/test_basic/test_workflow_info_second_stderr.gold.txt
  16. 1 1
      mainline/tests/general/test_basic/test_workflow_info_second_stdout.gold.txt
  17. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_default_stderr.gold.txt
  18. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_stderr.gold.txt
  19. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_all_stderr.gold.txt
  20. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_new_stderr.gold.txt
  21. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_touched_stderr.gold.txt
  22. 1 1
      mainline/tests/general/test_basic/test_workflow_limit_second_warn_trend_stderr.gold.txt
  23. 19 0
      mainline/tests/general/test_std_code_cpp/sources/function_ends_on_class.cpp
  24. 1 1
      mainline/tests/general/test_std_code_cpp/test_parser_export_default_stdout.gold.txt
  25. 93 4
      mainline/tests/general/test_std_code_cpp/test_parser_export_files_stdout.gold.txt
  26. 1 1
      mainline/tests/general/test_std_code_cs.py
  27. 1 1
      mainline/tests/general/test_std_code_java.py
  28. 10 0
      mainline/tests/general/test_std_code_java/sources/attrs.java
  29. 1 1
      mainline/tests/general/test_std_code_java/test_parser_export_default_stdout.gold.txt
  30. 59 2
      mainline/tests/general/test_std_code_java/test_parser_export_files_stdout.gold.txt

+ 9 - 4
mainline/core/dir.py

@@ -56,9 +56,9 @@ class Plugin(core.api.Plugin, core.api.Parent, core.api.IConfigurable, core.api.
         
     def run(self, args):
         if len(args) == 0:
-            self.reader.run(self, "./")
+            return self.reader.run(self, "./")
         for directory in args:
-            self.reader.run(self, directory)
+            return self.reader.run(self, directory)
         
     def add_exclude_rule(self, re_compiled_pattern):
         # TODO file name may have special regexp symbols what causes an exception
@@ -76,13 +76,14 @@ class DirectoryReader():
     def run(self, plugin, directory):
         
         def run_recursively(plugin, directory):
+            exit_code = 0
             for fname in os.listdir(directory):
                 full_path = os.path.join(directory, fname)
                 norm_path = re.sub(r'''[\\]''', "/", full_path)
                 if plugin.is_file_excluded(fname) == False:
                     if os.path.isdir(full_path):
                         if plugin.non_recursively == False:
-                            run_recursively(plugin, full_path)
+                            exit_code += run_recursively(plugin, full_path)
                     else:
                         parser = plugin.get_plugin_loader().get_parser(full_path)
                         if parser == None:
@@ -103,11 +104,15 @@ class DirectoryReader():
                                 data.set_data('general', 'procerrors', procerrors)
                             plugin.get_plugin_loader().get_database_loader().save_file_data(data)
                             logging.debug("-" * 60)
+                            exit_code += procerrors
                 else:
                     logging.info("Excluding: " + norm_path)
                     logging.debug("-" * 60)
+            return exit_code
         
-        run_recursively(plugin, directory)
+        total_errors = run_recursively(plugin, directory)
+        total_errors = total_errors # used, warnings are per file if not zero
+        return 0 # ignore errors, collection is successful anyway
     
 
 

+ 3 - 6
mainline/core/loader.py

@@ -29,7 +29,6 @@ class Loader(object):
         self.plugins = []
         self.parsers = []
         self.hash    = {}
-        self.exit_code = 0
         self.db = core.db.loader.Loader()
         
     def get_database_loader(self):
@@ -116,13 +115,11 @@ class Loader(object):
             item.terminate()
 
     def run(self, args):
+        exit_code = 0
         for item in self.iterate_plugins():
             if (isinstance(item, core.api.IRunable)):
-                item.run(args)
-        return self.exit_code
-
-    def inc_exit_code(self):
-        self.exit_code += 1
+                exit_code += item.run(args)
+        return exit_code
 
     def __repr__(self):
         result = object.__repr__(self) + ' with loaded:'

+ 0 - 2
mainline/ext/std/code/cpp.py

@@ -89,8 +89,6 @@ class CppCodeParser(object):
             re.DOTALL | re.MULTILINE | re.VERBOSE
         )
     
-    #TODO test false identification of class if function is named my_func_class()
-
     regex_ln = re.compile(r'(\n)|(\r)|(\r\n)')
 
     def run(self, data):

+ 1 - 1
mainline/ext/std/code/java.ini

@@ -18,7 +18,7 @@
 ;
 
 [Plugin]
-version: 1.0
+version: 1.1
 package: std.code
 module:  java
 class:   Plugin

+ 3 - 2
mainline/ext/std/code/java.py

@@ -65,7 +65,8 @@ class JavaCodeParser(object):
                                                                       # NOTE: it is slightly different in C++
                 | \'(?:\\.|[^\\\'])*\'                                # Match quoted strings
                 | "(?:\\.|[^\\"])*"                                   # Match double quoted strings
-                | (?P<fn_name>([_$a-zA-Z][_$a-zA-Z0-9]*))\s*[(]       # Match function
+                | (?P<fn_name>([@]?[_$a-zA-Z][_$a-zA-Z0-9]*))\s*[(]   # Match function
+                                                                      # NOTE: Matches attributes which are excluded later
                                                                       # NOTE: Java may include $ in the name
                                                                       # LIMITATION: if there are comments after function name
                                                                       # and before '(', it is not detected
@@ -243,7 +244,7 @@ class JavaCodeParser(object):
                 # ... if outside of a function
                 #     (do not detect functions enclosed directly in a function, i.e. without classes)
                 # ... and other name before has not been matched 
-                if blocks[curblk]['type'] != 'function' and (next_block['name'] == ""):
+                if blocks[curblk]['type'] != 'function' and (next_block['name'] == "") and m.group('fn_name')[0] != '@':
                     # - 'name'
                     next_block['name'] = m.group('fn_name').strip()
                     # - 'cursor'

+ 75 - 0
mainline/metrixpp.py

@@ -0,0 +1,75 @@
+#
+#    Metrix++, Copyright 2009-2013, Metrix++ Project
+#    Link: http://metrixplusplus.sourceforge.net
+#    
+#    This file is a part of Metrix++ Tool.
+#    
+#    Metrix++ is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, version 3 of the License.
+#    
+#    Metrix++ is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#    GNU General Public License for more details.
+#    
+#    You should have received a copy of the GNU General Public License
+#    along with Metrix++.  If not, see <http://www.gnu.org/licenses/>.
+#
+
+
+import time
+import sys
+import logging
+import os
+import subprocess
+import itertools
+
+import core.log
+
+def main():
+    
+    os.environ['METRIXPLUSPLUS_INSTALL_DIR'] = os.path.dirname(os.path.abspath(__file__))
+    
+    available_tools = []
+    for fname in os.listdir(os.path.join(os.environ['METRIXPLUSPLUS_INSTALL_DIR'], 'tools')):
+        tool_name = os.path.splitext(fname)[0]
+        if tool_name == '__init__':
+            continue
+        if tool_name not in available_tools:
+            available_tools.append(tool_name)
+
+    exemode = None
+    if len(sys.argv[1:]) != 0:
+        exemode = sys.argv[1]
+    if exemode != "-R" and exemode != "-D":
+        exemode = '-D' # TODO implement install and release mode
+        # inject '-D' or '-R' option
+        exit(subprocess.call(itertools.chain([sys.executable, sys.argv[0], '-D'], sys.argv[1:])))
+
+    command = ""
+    if len(sys.argv[1:]) > 1:
+        command = sys.argv[2]
+        
+    if command not in available_tools:
+        logging.error("Unknown action: " + str(command))
+        print "Usage: %prog <action> --help"
+        print "   or: %prog <action> [options] -- [path 1] ... [path N]"
+        print "where: actions are:"
+        for each in available_tools:
+            print "\t" + each
+        return 1
+
+    tool = __import__('tools', globals(), locals(), [command], -1)
+    module_attr = tool.__getattribute__(command)
+    class_attr = module_attr.__getattribute__('Tool')
+    instance = class_attr.__new__(class_attr)
+    instance.__init__()
+    return instance.run(sys.argv[3:])
+            
+if __name__ == '__main__':
+    ts = time.time()
+    core.log.set_default_format()
+    exit_code = main()
+    logging.warning("Exit code: " + str(exit_code) + ". Time spent: " + str(round((time.time() - ts), 2)) + " seconds. Done")
+    exit(exit_code)

+ 4 - 4
mainline/tests/general/test_basic.py

@@ -35,7 +35,7 @@ class Test(tests.common.TestCase):
         self.assertExec(runner.run())
 
         runner = tests.common.ToolRunner('export',
-                                         ['--general.log-level=INFO'],
+                                         ['--general.log-level=INFO', '--general.format=xml'],
                                          check_stderr=[(0, -1)])
         self.assertExec(runner.run())
 
@@ -63,14 +63,14 @@ class Test(tests.common.TestCase):
         self.assertExec(runner.run())
 
         runner = tests.common.ToolRunner('export',
-                                         ['--general.log-level=INFO'],
+                                         ['--general.log-level=INFO', '--general.format=xml'],
                                          check_stderr=[(0, -1)],
                                          prefix='second',
                                          use_prev=True)
         self.assertExec(runner.run())
 
         runner = tests.common.ToolRunner('export',
-                                         ['--general.log-level=INFO'],
+                                         ['--general.log-level=INFO', '--general.format=xml'],
                                          check_stderr=[(0, -1)],
                                          prefix='second_per_file',
                                          dirs_list=['./simple.cpp'],
@@ -169,7 +169,7 @@ class Test(tests.common.TestCase):
         self.assertExec(runner.run())
 
         runner = tests.common.ToolRunner('export',
-                                         ['--general.nest-regions'],
+                                         ['--general.nest-regions', '--general.format=xml'],
                                          prefix='nest',
                                          use_prev=True)
         self.assertExec(runner.run())

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

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Excluding: ./.unused.cpp
 [LOG]: INFO:	Skipping: ./dummy.txt
 [LOG]: INFO:	Processing: ./simple.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 1.92 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 2.4 seconds. Done

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

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Excluding: ./.unused.cpp
 [LOG]: INFO:	Processing: ./simple.cpp
 [LOG]: INFO:	Processing: ./simple2.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.18 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.29 seconds. Done

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

@@ -1,3 +1,3 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.02 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.14 seconds. Done

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

@@ -1,3 +1,3 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: ./simple.cpp
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.04 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.15 seconds. Done

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

@@ -1,3 +1,3 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.02 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.15 seconds. Done

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

@@ -1,2 +1,2 @@
 [LOG]: WARNING:	Logging enabled with INFO level
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.01 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.1 seconds. Done

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

@@ -6,7 +6,7 @@ Properties:
 	std.code.cpp:files	=>	*.c,*.cc,*.cpp,*.cxx,*.h,*.hh,*.hpp,*.hxx
 	std.code.cs:version	=>	1.0
 	std.code.cs:files	=>	*.cs
-	std.code.java:version	=>	1.0
+	std.code.java:version	=>	1.1
 	std.code.java:files	=>	*.java
 Namespaces:
 	std.code.complexity

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

@@ -1,2 +1,2 @@
 [LOG]: WARNING:	Logging enabled with INFO level
-[LOG]: WARNING:	Exit code: 0. Time spent: 0.02 seconds. Done
+[LOG]: WARNING:	Exit code: 0. Time spent: 0.11 seconds. Done

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

@@ -6,7 +6,7 @@ Properties:
 	std.code.cpp:files	=>	*.c,*.cc,*.cpp,*.cxx,*.h,*.hh,*.hpp,*.hxx
 	std.code.cs:version	=>	1.0
 	std.code.cs:files	=>	*.cs
-	std.code.java:version	=>	1.0
+	std.code.java:version	=>	1.1
 	std.code.java:files	=>	*.java
 Namespaces:
 	std.code.complexity

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

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 4. Time spent: 0.02 seconds. Done
+[LOG]: WARNING:	Exit code: 4. Time spent: 0.14 seconds. Done

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

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 6. Time spent: 0.03 seconds. Done
+[LOG]: WARNING:	Exit code: 6. Time spent: 0.14 seconds. Done

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

@@ -1,4 +1,4 @@
 [LOG]: WARNING:	Logging enabled with INFO level
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 6. Time spent: 0.03 seconds. Done
+[LOG]: WARNING:	Exit code: 6. Time spent: 0.14 seconds. Done

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

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 2. Time spent: 0.03 seconds. Done
+[LOG]: WARNING:	Exit code: 2. Time spent: 0.15 seconds. Done

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

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 4. Time spent: 0.03 seconds. Done
+[LOG]: WARNING:	Exit code: 4. Time spent: 0.14 seconds. Done

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

@@ -2,4 +2,4 @@
 [LOG]: INFO:	Identifying changed files...
 [LOG]: INFO:	Processing: 
 [LOG]: INFO:	Applying limit: namespace 'std.code.complexity', filter '('cyclomatic', '>', 0.0)'
-[LOG]: WARNING:	Exit code: 3. Time spent: 0.03 seconds. Done
+[LOG]: WARNING:	Exit code: 3. Time spent: 0.14 seconds. Done

+ 19 - 0
mainline/tests/general/test_std_code_cpp/sources/function_ends_on_class.cpp

@@ -0,0 +1,19 @@
+
+namespace my_namespace {
+
+class my_class {
+	int function_end_on_class()
+	{
+
+	}
+	int function_end_on_struct()
+	{
+
+	}
+	int function_end_on_namespace()
+	{
+
+	}
+};
+
+}

+ 1 - 1
mainline/tests/general/test_std_code_cpp/test_parser_export_default_stdout.gold.txt

@@ -10,7 +10,7 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="2" total="17.0" avg="0.204819277108" min="0" />
+                <cyclomatic max="2" total="17.0" avg="0.197674418605" min="0" />
             </std.code.complexity>
         </aggregated-data>
     </data>

+ 93 - 4
mainline/tests/general/test_std_code_cpp/test_parser_export_files_stdout.gold.txt

@@ -5,7 +5,7 @@ ________________________________________________________________________________
 --------------------------------------------------------------------------------
 data:  
 .   info: 
-.   .   path=".\operator_test.hpp"
+.   .   path=".\function_ends_on_class.cpp"
 .   .   id="1"
 .   file-data:  
 .   .   regions:
@@ -14,6 +14,95 @@ data:
 .   .   .   .   info: 
 .   .   .   .   .   cursor="0"
 .   .   .   .   .   name="__global__"
+.   .   .   .   .   offset_end="163"
+.   .   .   .   .   line_begin="2"
+.   .   .   .   .   type="global"
+.   .   .   .   .   line_end="20"
+.   .   .   .   .   offset_begin="1"
+.   .   .   .   data: 
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="2"
+.   .   .   .   .   name="my_namespace"
+.   .   .   .   .   offset_end="162"
+.   .   .   .   .   line_begin="2"
+.   .   .   .   .   type="namespace"
+.   .   .   .   .   line_end="19"
+.   .   .   .   .   offset_begin="1"
+.   .   .   .   data: 
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="4"
+.   .   .   .   .   name="my_class"
+.   .   .   .   .   offset_end="158"
+.   .   .   .   .   line_begin="4"
+.   .   .   .   .   type="class"
+.   .   .   .   .   line_end="17"
+.   .   .   .   .   offset_begin="27"
+.   .   .   .   data: 
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="5"
+.   .   .   .   .   name="function_end_on_class"
+.   .   .   .   .   offset_end="79"
+.   .   .   .   .   line_begin="5"
+.   .   .   .   .   type="function"
+.   .   .   .   .   line_end="8"
+.   .   .   .   .   offset_begin="45"
+.   .   .   .   data:  
+.   .   .   .   .   std.code.complexity: 
+.   .   .   .   .   .   cyclomatic="0"
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="9"
+.   .   .   .   .   name="function_end_on_struct"
+.   .   .   .   .   offset_end="116"
+.   .   .   .   .   line_begin="9"
+.   .   .   .   .   type="function"
+.   .   .   .   .   line_end="12"
+.   .   .   .   .   offset_begin="81"
+.   .   .   .   data:  
+.   .   .   .   .   std.code.complexity: 
+.   .   .   .   .   .   cyclomatic="0"
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="13"
+.   .   .   .   .   name="function_end_on_namespace"
+.   .   .   .   .   offset_end="156"
+.   .   .   .   .   line_begin="13"
+.   .   .   .   .   type="function"
+.   .   .   .   .   line_end="16"
+.   .   .   .   .   offset_begin="118"
+.   .   .   .   data:  
+.   .   .   .   .   std.code.complexity: 
+.   .   .   .   .   .   cyclomatic="0"
+.   subfiles:
+.   subdirs:
+.   aggregated-data:  
+.   .   std.code.complexity:  
+.   .   .   cyclomatic: 
+.   .   .   .   max="0"
+.   .   .   .   total="0.0"
+.   .   .   .   avg="0.0"
+.   .   .   .   min="0"
+================================================================================
+--------------------------------------------------------------------------------
+data:  
+.   info: 
+.   .   path=".\operator_test.hpp"
+.   .   id="2"
+.   file-data:  
+.   .   regions:
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="0"
+.   .   .   .   .   name="__global__"
 .   .   .   .   .   offset_end="2068"
 .   .   .   .   .   line_begin="2"
 .   .   .   .   .   type="global"
@@ -719,7 +808,7 @@ data:
 data:  
 .   info: 
 .   .   path=".\test.c"
-.   .   id="2"
+.   .   id="3"
 .   file-data:  
 .   .   regions:
 .   .   
@@ -1125,7 +1214,7 @@ data:
 data:  
 .   info: 
 .   .   path=".\test2.cpp"
-.   .   id="3"
+.   .   id="4"
 .   file-data:  
 .   .   regions:
 .   .   
@@ -1227,7 +1316,7 @@ data:
 data:  
 .   info: 
 .   .   path=".\test3.cpp"
-.   .   id="4"
+.   .   id="5"
 .   file-data:  
 .   .   regions:
 .   .   

+ 1 - 1
mainline/tests/general/test_std_code_cs.py

@@ -30,7 +30,7 @@ class Test(tests.common.TestCase):
         runner = tests.common.ToolRunner('collect', ['--std.code.complexity.on'])
         self.assertExec(runner.run())
 
-        runner = tests.common.ToolRunner('export', ['--general.nest-regions'])
+        runner = tests.common.ToolRunner('export', ['--general.nest-regions', '--general.format=xml'])
         self.assertExec(runner.run())
 
         dirs_list = [os.path.join('.', each) for each in os.listdir(self.get_content_paths().cwd)]

+ 1 - 1
mainline/tests/general/test_std_code_java.py

@@ -30,7 +30,7 @@ class Test(tests.common.TestCase):
         runner = tests.common.ToolRunner('collect', ['--std.code.complexity.on'])
         self.assertExec(runner.run())
 
-        runner = tests.common.ToolRunner('export', ['--general.nest-regions'])
+        runner = tests.common.ToolRunner('export', ['--general.nest-regions', '--general.format=xml'])
         self.assertExec(runner.run())
 
         dirs_list = [os.path.join('.', each) for each in os.listdir(self.get_content_paths().cwd)]

+ 10 - 0
mainline/tests/general/test_std_code_java/sources/attrs.java

@@ -0,0 +1,10 @@
+
+@attribute_should_not_be_a_function("word")
+class A
+{
+	@nested_attribute_should_not_be_a_function("word")
+	int function()
+	{
+		
+	}
+}

+ 1 - 1
mainline/tests/general/test_std_code_java/test_parser_export_default_stdout.gold.txt

@@ -10,7 +10,7 @@
         </subdirs>
         <aggregated-data>
             <std.code.complexity>
-                <cyclomatic max="6" total="126.0" avg="1.06779661017" min="0" />
+                <cyclomatic max="6" total="126.0" avg="1.05882352941" min="0" />
             </std.code.complexity>
         </aggregated-data>
     </data>

+ 59 - 2
mainline/tests/general/test_std_code_java/test_parser_export_files_stdout.gold.txt

@@ -660,7 +660,7 @@ data:
 --------------------------------------------------------------------------------
 data:  
 .   info: 
-.   .   path=".\BinaryHeapPriorityQueue.java"
+.   .   path=".\attrs.java"
 .   .   id="2"
 .   file-data:  
 .   .   regions:
@@ -669,6 +669,63 @@ data:
 .   .   .   .   info: 
 .   .   .   .   .   cursor="0"
 .   .   .   .   .   name="__global__"
+.   .   .   .   .   offset_end="133"
+.   .   .   .   .   line_begin="2"
+.   .   .   .   .   type="global"
+.   .   .   .   .   line_end="10"
+.   .   .   .   .   offset_begin="1"
+.   .   .   .   data: 
+.   .   .   .   subregions:
+.   .   .   .   
+.   .   .   .   .   subregion:  
+.   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   cursor="3"
+.   .   .   .   .   .   .   name="A"
+.   .   .   .   .   .   .   offset_end="133"
+.   .   .   .   .   .   .   line_begin="2"
+.   .   .   .   .   .   .   type="class"
+.   .   .   .   .   .   .   line_end="10"
+.   .   .   .   .   .   .   offset_begin="1"
+.   .   .   .   .   .   data: 
+.   .   .   .   .   .   subregions:
+.   .   .   .   .   .   
+.   .   .   .   .   .   .   subregion:  
+.   .   .   .   .   .   .   .   info: 
+.   .   .   .   .   .   .   .   .   cursor="6"
+.   .   .   .   .   .   .   .   .   name="function"
+.   .   .   .   .   .   .   .   .   offset_end="131"
+.   .   .   .   .   .   .   .   .   line_begin="5"
+.   .   .   .   .   .   .   .   .   type="function"
+.   .   .   .   .   .   .   .   .   line_end="9"
+.   .   .   .   .   .   .   .   .   offset_begin="56"
+.   .   .   .   .   .   .   .   data:  
+.   .   .   .   .   .   .   .   .   std.code.complexity: 
+.   .   .   .   .   .   .   .   .   .   cyclomatic="0"
+.   .   .   .   .   .   .   .   subregions:
+.   .   std.code.complexity: 
+.   .   .   cyclomatic="0"
+.   subfiles:
+.   subdirs:
+.   aggregated-data:  
+.   .   std.code.complexity:  
+.   .   .   cyclomatic: 
+.   .   .   .   max="0"
+.   .   .   .   total="0.0"
+.   .   .   .   avg="0.0"
+.   .   .   .   min="0"
+================================================================================
+--------------------------------------------------------------------------------
+data:  
+.   info: 
+.   .   path=".\BinaryHeapPriorityQueue.java"
+.   .   id="3"
+.   file-data:  
+.   .   regions:
+.   .   
+.   .   .   region:  
+.   .   .   .   info: 
+.   .   .   .   .   cursor="0"
+.   .   .   .   .   name="__global__"
 .   .   .   .   .   offset_end="13739"
 .   .   .   .   .   line_begin="1"
 .   .   .   .   .   type="global"
@@ -1330,7 +1387,7 @@ data:
 data:  
 .   info: 
 .   .   path=".\Generics.java"
-.   .   id="3"
+.   .   id="4"
 .   file-data:  
 .   .   regions:
 .   .