validate:tools: Do not duplicated name in the classname in xunit reports

This commit is contained in:
Thibault Saunier 2014-01-10 16:46:00 +01:00
parent 654bacebc9
commit 26e3a9e3c5
3 changed files with 15 additions and 5 deletions

View file

@ -138,7 +138,8 @@ class GstValidateManager(TestsManager, Loggable):
if config.getboolean("media-info", "is-image") is True:
continue
for comb in COMBINATIONS:
classname = "validate.transcode.to_%s" % (str(comb).replace(' ', '_'))
classname = "validate.transcode.to_%s.%s" % (str(comb).replace(' ', '_'),
os.path.splitext(os.path.basename(uri))[0].replace(".", "_"))
self.tests.append(GstValidateTranscodingTest(classname,
self.options,
self.reporter,

View file

@ -63,6 +63,15 @@ class Test(Loggable):
return string
def get_classname(self):
name = self.classname.split('.')[-1]
classname = self.classname.replace('.%s' % name, '')
return classname
def get_name(self):
return self.classname.split('.')[-1]
def add_arguments(self, *args):
for arg in args:
self.command += " " + arg

View file

@ -176,8 +176,8 @@ class XunitReporter(Reporter):
'<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
'<failure type=%(errtype)s message=%(message)s>'
'</failure>%(systemout)s</testcase>' %
{'cls': self._quoteattr(test.classname),
'name': self._quoteattr(test.classname.split('.')[-1]),
{'cls': self._quoteattr(test.get_classname()),
'name': self._quoteattr(test.get_name()),
'taken': test.time_taken,
'errtype': self._quoteattr(test.result),
'message': self._quoteattr(test.message),
@ -191,8 +191,8 @@ class XunitReporter(Reporter):
self.errorlist.append(
'<testcase classname=%(cls)s name=%(name)s '
'time="%(taken).3f">%(systemout)s</testcase>' %
{'cls': self._quoteattr(test.classname),
'name': self._quoteattr(test.classname.split('.')[-1]),
{'cls': self._quoteattr(test.get_classname()),
'name': self._quoteattr(test.get_name()),
'taken': test.time_taken,
'systemout': self._get_captured(),
})