':param test: Qualified name for test case.
Should have next format:
{packagename}.{path.to.class.in.module}.{testcase}.
Examples:
scripts.script-afd.test_afd
core.controllers.auto_update.tests.test_autoupd.TesVMgr.testXXX
:param err: Error string
:param took: Time that took the test to run.'

def add_error(self, test, err, took, skipped=False):

    if skipped:
        self._stats['skip'] += 1
    else:
        self._stats['error'] += 1
    quoteattr = saxutils.quoteattr
    errlinedets = err.split('\n')[(-1)].split(':', 1)
    (pkg, _, id) = test.rpartition('.')
    self.results.append(('<testcase    classname=%(pkg)s    name=%(name)s    time="%(took)d"><error    type=%(errtype)s    message=%(message)s><![CDATA[%(tb)s]]></error></testcase>' % {'name': quoteattr(id), 'pkg': quoteattr(pkg), 'took': took, 'errtype': quoteattr(errlinedets[0]), 'message': quoteattr(errlinedets[(-1)]), 'tb': err}))
