Saner handling for unit tests in the runner

This commit is contained in:
Nick Hurley 2013-02-01 16:00:07 -08:00
Родитель c198cda4a4
Коммит 709f4b8d19
2 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -86,17 +86,15 @@ class StoneRidgeRunner(object):
# Ensure our output directory exists
outdir = stoneridge.get_config('run', 'out')
if self.unittest:
xpcoutdir = os.path.join(outdir, 'xpcoutdir')
else:
xpcoutdir = stoneridge.get_xpcshell_output_directory()
logging.debug('ensuring %s exists' % (xpcoutdir,))
try:
os.makedirs(xpcoutdir)
logging.debug('%s created' % (xpcoutdir,))
except OSError:
logging.debug('%s already exists' % (xpcoutdir,))
pass
xpcoutdir = stoneridge.get_xpcshell_output_directory()
if not self.unittest:
logging.debug('ensuring %s exists' % (xpcoutdir,))
try:
os.makedirs(xpcoutdir)
logging.debug('%s created' % (xpcoutdir,))
except OSError:
logging.debug('%s already exists' % (xpcoutdir,))
pass
installroot = stoneridge.get_config('stoneridge', 'root')
xpcoutleaf = stoneridge.get_config('run', 'xpcoutleaf')

Просмотреть файл

@ -160,7 +160,10 @@ def run_xpcshell(args, stdout=subprocess.PIPE):
bindir = get_config('run', 'bin')
if bindir is None:
return (None, None)
return (None, [])
if not os.path.exists(bindir):
return (None, [])
if _xpcshell_environ is None:
_xpcshell_environ = copy.copy(os.environ)