bug 459114 - helper function to provide a clean profile directory for xpcshell tests. r=sdwilsh

This commit is contained in:
Ted Mielczarek
2009-05-14 07:37:40 -04:00
parent 8f33e7c96d
commit d1eb2fade9
28 changed files with 302 additions and 554 deletions

View File

@@ -37,11 +37,12 @@
#
# ***** END LICENSE BLOCK ***** */
import re, sys, os, os.path, logging
import re, sys, os, os.path, logging, shutil
import tempfile
from glob import glob
from optparse import OptionParser
from subprocess import Popen, PIPE, STDOUT
from tempfile import mkdtemp
from automationutils import addCommonOptions, checkForCrashes
@@ -226,8 +227,13 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
proc = Popen(cmdH + cmdT + xpcsRunArgs,
stdout=pStdout, stderr=pStderr, env=env, cwd=testdir)
# |stderr == None| as |pStderr| was either |None| or redirected to |stdout|.
# create a temp dir that the JS harness can stick a profile in
profd = mkdtemp()
env["XPCSHELL_TEST_PROFILE_DIR"] = profd
stdout, stderr = proc.communicate()
shutil.rmtree(profd, True)
if interactive:
# not sure what else to do here...
return True