Browse Source

added metrix++.py file

avkonst 11 years ago
parent
commit
b4ec65d15a

+ 2 - 2
mainline/CHANGELOG.md

@@ -3,7 +3,7 @@
 
 ## 1.1 (March, 2013)
 - **Extension point for post analysis tools** added. All tools are merged
-  to one 'metrixpp.py' with plugable actions, like collect, limit, etc:
-  run 'python metrixpp.py' to get the list of actions supported.
+  to one 'metrix++.py' with plugable actions, like collect, limit, etc:
+  run 'python metrix++.py' to get the list of actions supported.
 - fixed Java parser (fixed false match of attributes as functions)
 

+ 23 - 0
mainline/metrix++.py

@@ -0,0 +1,23 @@
+#
+#    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/>.
+#
+
+
+if __name__ == '__main__':
+    import metrixpp
+    metrixpp.start()

+ 6 - 3
mainline/metrixpp.py

@@ -31,7 +31,7 @@ def main():
     
     os.environ['METRIXPLUSPLUS_INSTALL_DIR'] = os.path.dirname(os.path.abspath(__file__))
     
-    this_file = os.path.basename(__file__)
+    this_file = os.path.basename(sys.argv[0])
     
     available_tools = []
     excluded_tools = ['utils']
@@ -79,7 +79,7 @@ def main():
     instance.__init__()
     return instance.run(sys.argv[3:])
 
-if __name__ == '__main__':
+def start():
     ts = time.time()
     core.log.set_default_format()
     exit_code = main()
@@ -88,4 +88,7 @@ if __name__ == '__main__':
         os.environ['METRIXPLUSPLUS_TEST_GENERATE_GOLDS'] == "True":
         time_spent = 1 # Constant value if under tests
     logging.warning("Done (" + str(time_spent) +" seconds). Exit code: " + str(exit_code))
-    exit(exit_code)
+    exit(exit_code)
+
+if __name__ == '__main__':
+    start()

+ 1 - 1
mainline/tests/common.py

@@ -74,7 +74,7 @@ class ToolRunner(object):
             for each in dirs_list:
                 self.dirs_list.append(each)
                
-        self.call_args = ['python', os.path.join(os.environ['METRIXPLUSPLUS_INSTALL_DIR'], "metrixpp.py"), tool_name] \
+        self.call_args = ['python', os.path.join(os.environ['METRIXPLUSPLUS_INSTALL_DIR'], "metrix++.py"), tool_name] \
                     + db_opts + opts_list + ['--'] + self.dirs_list
         self.cmd = " ".join(self.call_args)
         self.exit_code_expected = exit_code

+ 2 - 2
mainline/tests/general/test_basic/test_help_--help_default_stdout.gold.txt

@@ -1,5 +1,5 @@
-Usage: python metrixpp.py <action> --help
-   or: python metrixpp.py <action> [options] -- [path 1] ... [path N]
+Usage: python metrix++.py <action> --help
+   or: python metrix++.py <action> [options] -- [path 1] ... [path N]
 where: actions are:
 	collect
 	info

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

@@ -1,4 +1,4 @@
-Usage: metrixpp.py collect [options] -- [path 1] ... [path N]
+Usage: metrix++.py collect [options] -- [path 1] ... [path N]
 
 Options:
   -h, --help            show this help message and exit

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

@@ -1,4 +1,4 @@
-Usage: metrixpp.py export [options] -- [path 1] ... [path N]
+Usage: metrix++.py export [options] -- [path 1] ... [path N]
 
 Options:
   -h, --help            show this help message and exit

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

@@ -1,4 +1,4 @@
-Usage: metrixpp.py info [options] -- [path 1] ... [path N]
+Usage: metrix++.py info [options] -- [path 1] ... [path N]
 
 Options:
   -h, --help            show this help message and exit

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

@@ -1,4 +1,4 @@
-Usage: metrixpp.py limit [options] -- [path 1] ... [path N]
+Usage: metrix++.py limit [options] -- [path 1] ... [path N]
 
 Options:
   -h, --help            show this help message and exit

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

@@ -1,4 +1,4 @@
-Usage: metrixpp.py view [options] -- [path 1] ... [path N]
+Usage: metrix++.py view [options] -- [path 1] ... [path N]
 
 Options:
   -h, --help            show this help message and exit