test_std_code_cs_unit.py 1021 B

12345678910111213141516171819202122232425262728293031
  1. #
  2. # Metrix++, Copyright 2009-2019, Metrix++ Project
  3. # Link: https://github.com/metrixplusplus/metrixplusplus
  4. #
  5. # This file is a part of Metrix++ Tool.
  6. #
  7. import unittest
  8. import os
  9. import tests.common
  10. class Test(tests.common.TestCase):
  11. def test_parser(self):
  12. runner = tests.common.ToolRunner('collect', ['--std.code.complexity.cyclomatic'])
  13. self.assertExec(runner.run())
  14. runner = tests.common.ToolRunner('view', ['--nest-regions', '--format=xml'])
  15. self.assertExec(runner.run())
  16. dirs_list = [os.path.join('.', each) for each in sorted(os.listdir(self.get_content_paths().cwd))]
  17. runner = tests.common.ToolRunner('view',
  18. opts_list=['--nest-regions', '--format=txt'],
  19. dirs_list=dirs_list,
  20. prefix='files')
  21. self.assertExec(runner.run())
  22. if __name__ == '__main__':
  23. unittest.main()