avocado.job: Fix return code of stand alone tests

When running stand alone tests, ie, tests without
the avocado runner, I surely do expect they return
exit codes according to wether it passed or failed.

This patch fixed that by making the TestModuleRunner
class to return appropriate return codes from the
Job.run() function.
Signed-off-by: NLucas Meneghel Rodrigues <lmr@redhat.com>
上级 654098b8
......@@ -187,15 +187,16 @@ class TestModuleRunner(object):
self.module = getattr(self.module, part)
else:
self.module = module
url = None
self.url = None
for key, value in self.module.__dict__.iteritems():
try:
if issubclass(value, test.Test):
url = key
self.url = key
except TypeError:
pass
self.job = Job()
if url is not None:
self.job.run(urls=[url])
if self.url is not None:
sys.exit(self.job.run(urls=[self.url]))
sys.exit(error_codes.numeric_status['AVOCADO_ALL_OK'])
main = TestModuleRunner
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册