Create the output_dir for the test subcommand.

This change creates the output directory for the test subcommand if it
does not yet exist. If it exists, use it. Any other exceptions are
re-raised.

Change-Id: I487c69e70f9b6c475691ca4fef4669a0c318ab55
This commit is contained in:
Florian Preinstorfer 2014-04-15 16:07:35 +02:00
parent 8d74c20240
commit e0549303e7
1 changed files with 5 additions and 0 deletions

View File

@ -580,6 +580,11 @@ class Builder(object):
if names:
print job.output()
continue
try:
os.makedirs(output_dir)
except OSError:
if not os.path.isdir(output_dir):
raise
fn = os.path.join(output_dir, job.name)
logger.debug("Writing XML to '{0}'".format(fn))
f = open(fn, 'w')