Mercurial > bitten > bitten-test
comparison bitten/build/javatools.py @ 605:c94481bc4646
0.6dev: Reverting [677] as many of these paths are also used for URLs, and hadn't considered this change enough. No major point in changing code that already works well, so simply reverting seems the best idea...
author | osimons |
---|---|
date | Thu, 30 Jul 2009 19:51:11 +0000 |
parents | 7af6ebc30ff8 |
children | 21902b481ee7 |
comparison
equal
deleted
inserted
replaced
604:74618e617c4c | 605:c94481bc4646 |
---|---|
12 """Recipe commands for tools commonly used in Java projects.""" | 12 """Recipe commands for tools commonly used in Java projects.""" |
13 | 13 |
14 from glob import glob | 14 from glob import glob |
15 import logging | 15 import logging |
16 import os | 16 import os |
17 import posixpath | |
17 import shlex | 18 import shlex |
18 import tempfile | 19 import tempfile |
19 | 20 |
20 from bitten.build import CommandLine | 21 from bitten.build import CommandLine |
21 from bitten.util import xmlio | 22 from bitten.util import xmlio |
117 test.attr['fixture'] = testcase.attr['classname'] | 118 test.attr['fixture'] = testcase.attr['classname'] |
118 if 'time' in testcase.attr: | 119 if 'time' in testcase.attr: |
119 test.attr['duration'] = testcase.attr['time'] | 120 test.attr['duration'] = testcase.attr['time'] |
120 if srcdir is not None: | 121 if srcdir is not None: |
121 cls = testcase.attr['classname'].split('.') | 122 cls = testcase.attr['classname'].split('.') |
122 test.attr['file'] = os.path.join(srcdir, *cls) + \ | 123 test.attr['file'] = posixpath.join(srcdir, *cls) + \ |
123 '.java' | 124 '.java' |
124 | 125 |
125 result = list(testcase.children()) | 126 result = list(testcase.children()) |
126 if result: | 127 if result: |
127 test.attr['status'] = result[0].name | 128 test.attr['status'] = result[0].name |
214 counter[line.attr['number']] = line.attr['hits'] | 215 counter[line.attr['number']] = line.attr['hits'] |
215 | 216 |
216 for filename, name in class_names.iteritems(): | 217 for filename, name in class_names.iteritems(): |
217 counter = counters[filename] | 218 counter = counters[filename] |
218 module = xmlio.Element('coverage', name=name, | 219 module = xmlio.Element('coverage', name=name, |
219 file=os.path.join(srcdir, filename), | 220 file=posixpath.join(srcdir, filename), |
220 lines=counter.num_lines, | 221 lines=counter.num_lines, |
221 percentage=counter.percentage) | 222 percentage=counter.percentage) |
222 module.append(xmlio.Element('line_hits')[counter.line_hits]) | 223 module.append(xmlio.Element('line_hits')[counter.line_hits]) |
223 coverage.append(module) | 224 coverage.append(module) |
224 ctxt.report('coverage', coverage) | 225 ctxt.report('coverage', coverage) |