diff --git a/python/catkin/test_results.py b/python/catkin/test_results.py index 0a8d1e1d2..facbf1a28 100644 --- a/python/catkin/test_results.py +++ b/python/catkin/test_results.py @@ -158,7 +158,7 @@ def _get_testsuite_stats(node): num_tests = int(node.attrib['tests']) num_errors = int(node.attrib['errors']) num_failures = int(node.attrib['failures']) - num_skipped = int(node.get('skip', '0')) + int(node.get('disabled', '0')) + num_skipped = int(node.get('skip', '0')) + int(node.get('skipped', '0')) + int(node.get('disabled', '0')) return (num_tests, num_errors, num_failures, num_skipped) diff --git a/test/unit_tests/test_test_results.py b/test/unit_tests/test_test_results.py index 3431a3782..18d587b6c 100644 --- a/test/unit_tests/test_test_results.py +++ b/test/unit_tests/test_test_results.py @@ -48,6 +48,20 @@ def test_read_junit_skip(self): finally: shutil.rmtree(rootdir) + def test_read_junit_skipped(self): + try: + rootdir = tempfile.mkdtemp() + + result_file = os.path.join(rootdir, 'test1.xml') + with open(result_file, 'w') as fhand: + fhand.write('') + (num_tests, num_errors, num_failures) = catkin_test_results.read_junit(result_file) + self.assertEqual((5, 1, 3), (num_tests, num_errors, num_failures)) + (num_tests, num_errors, num_failures, num_skipped) = catkin_test_results.read_junit2(result_file) + self.assertEqual((5, 1, 3, 2), (num_tests, num_errors, num_failures, num_skipped)) + finally: + shutil.rmtree(rootdir) + def test_test_results(self): try: rootdir = tempfile.mkdtemp()