updated on Thu Jan 19 00:16:31 UTC 2012
[aur-mirror.git] / bitten-svn / bitten-cunit.patch
blob2a9e202a4bca5f0947df28fe7f34e03bcc9087d0
1 Fix an issue with CUnit where failed tests are counted once for each failed assertion.
3 diff -r 08cdddd4e18c bitten/build/ctools.py
4 --- a/bitten/build/ctools.py Fri Apr 10 15:00:11 2009 +0200
5 +++ b/bitten/build/ctools.py Fri Apr 10 15:05:37 2009 +0200
6 @@ -245,11 +245,20 @@
7 continue
8 suiteName = suite.children ('SUITE_NAME').next().gettext()
9 info ("%s [%s]" % ("*" * (57 - len (suiteName)), suiteName))
10 + testResults = set()
11 for record in suite.children ('CUNIT_RUN_TEST_RECORD'):
12 for result in record.children():
13 if result.name not in ('CUNIT_RUN_TEST_SUCCESS', 'CUNIT_RUN_TEST_FAILURE'):
14 continue
15 testName = result.children ('TEST_NAME').next().gettext()
16 + if testName in testResults:
17 + if result.name == 'CUNIT_RUN_TEST_FAILURE':
18 + error ("%s(%d): %s"
19 + % (result.children ('FILE_NAME').next().gettext(),
20 + int (result.children ('LINE_NUMBER').next().gettext()),
21 + result.children ('CONDITION').next().gettext()))
22 + continue
23 + testResults.add (testName)
24 info ("Running %s..." % testName);
25 test = xmlio.Element('test')
26 test.attr['fixture'] = suiteName