##// END OF EJS Templates
Allow xunit and coverage output
Thomas Kluyver -
Show More
@@ -65,7 +65,9 b' class IPTestController(object):'
65 self.cmd.extend(['--with-xunit', '--xunit-file', xunit_file])
65 self.cmd.extend(['--with-xunit', '--xunit-file', xunit_file])
66
66
67 def add_coverage(self, xml=True):
67 def add_coverage(self, xml=True):
68 self.cmd.extend(['--with-coverage', '--cover-package', self.section])
68 self.cmd.append('--with-coverage')
69 for include in test_sections[self.section].includes:
70 self.cmd.extend(['--cover-package', include])
69 if xml:
71 if xml:
70 coverage_xml = os.path.abspath(self.section + ".coverage.xml")
72 coverage_xml = os.path.abspath(self.section + ".coverage.xml")
71 self.cmd.extend(['--cover-xml', '--cover-xml-file', coverage_xml])
73 self.cmd.extend(['--cover-xml', '--cover-xml-file', coverage_xml])
@@ -117,7 +119,7 b' class IPTestController(object):'
117
119
118 __del__ = cleanup
120 __del__ = cleanup
119
121
120 def test_controllers_to_run(inc_slow=False):
122 def test_controllers_to_run(inc_slow=False, xunit=False, coverage=False):
121 """Returns an ordered list of IPTestController instances to be run."""
123 """Returns an ordered list of IPTestController instances to be run."""
122 res = []
124 res = []
123 if not inc_slow:
125 if not inc_slow:
@@ -125,7 +127,12 b' def test_controllers_to_run(inc_slow=False):'
125
127
126 for name in test_group_names:
128 for name in test_group_names:
127 if test_sections[name].will_run:
129 if test_sections[name].will_run:
128 res.append(IPTestController(name))
130 controller = IPTestController(name)
131 if xunit:
132 controller.add_xunit()
133 if coverage:
134 controller.add_coverage(xml=True)
135 res.append(controller)
129 return res
136 return res
130
137
131 def do_run(controller):
138 def do_run(controller):
@@ -193,7 +200,8 b' def run_iptestall(inc_slow=False, jobs=1, xunit=False, coverage=False):'
193 if jobs != 1:
200 if jobs != 1:
194 IPTestController.buffer_output = True
201 IPTestController.buffer_output = True
195
202
196 controllers = test_controllers_to_run(inc_slow=inc_slow)
203 controllers = test_controllers_to_run(inc_slow=inc_slow, xunit=xunit,
204 coverage=coverage)
197
205
198 # Run all test runners, tracking execution time
206 # Run all test runners, tracking execution time
199 failed = []
207 failed = []
General Comments 0
You need to be logged in to leave comments. Login now