Bug 484604 - OS/2 problem with running the new python test program; r=ted.mielczarek

This commit is contained in:
Walter Meinl 2009-06-02 00:21:34 +02:00
parent c5db2caabd
commit bc69b8d01f

View File

@ -125,6 +125,9 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
xrePath = os.path.abspath(xrePath)
if sys.platform == 'win32':
env["PATH"] = env["PATH"] + ";" + xrePath
elif sys.platform in ('os2emx', 'os2knix'):
os.environ["BEGINLIBPATH"] = xrePath + ";" + env["BEGINLIBPATH"]
os.environ["LIBPATHSTRICT"] = "T"
elif sys.platform == 'osx':
env["DYLD_LIBRARY_PATH"] = xrePath
else: # unix or linux?
@ -189,7 +192,10 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
# Now execute each test individually.
for test in testfiles:
pstdout = PIPE
if sys.platform == 'os2emx':
pstdout = None
else:
pstdout = PIPE
pstderr = STDOUT
interactiveargs = []
if interactive:
@ -208,7 +214,7 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
# not sure what else to do here...
return True
if proc.returncode != 0 or stdout.find("*** PASS") == -1:
if proc.returncode != 0 or (stdout is not None and stdout.find("*** PASS") == -1):
print """TEST-UNEXPECTED-FAIL | %s | test failed (with xpcshell return code: %d), see following log:
>>>>>>>
%s
@ -220,14 +226,15 @@ def runTests(xpcshell, testdirs=[], xrePath=None, testPath=None,
leakReport = processLeakLog(leakLogFile)
try:
f = open(test + '.log', 'w')
f.write(stdout)
if leakReport:
f.write(leakReport)
finally:
if f:
f.close()
if stdout is not None:
try:
f = open(test + '.log', 'w')
f.write(stdout)
if leakReport:
f.write(leakReport)
finally:
if f:
f.close()
# Remove the leak detection file (here) so it can't "leak" to the next test.
# The file is not there if leak logging was not enabled in the xpcshell build.