Bug 688762 - add try/except blocks around all harnesses so we always return an error code. r=bear

This commit is contained in:
Joel Maher 2011-09-26 07:41:19 -04:00
Родитель e0cdbc7dcb
Коммит 23f6fb12f0
3 изменённых файлов: 22 добавлений и 4 удалений

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

@ -706,7 +706,11 @@ class DeviceManagerSUT(DeviceManager):
if localFile == '':
localFile = os.path.join(self.tempRoot, "temp.txt")
retVal = self.pullFile(remoteFile)
try:
retVal = self.pullFile(remoteFile)
except:
return None
if (retVal is None):
return None

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

@ -440,7 +440,13 @@ def main():
#an example manifest name to use on the cli
# manifest = "http://" + options.remoteWebServer + "/reftests/layout/reftests/reftest-sanity/reftest.list"
reftest.runTests(manifest, options)
try:
reftest.runTests(manifest, options)
except:
print "TEST-UNEXPECTED-FAIL | | exception while running reftests"
reftest.stopWebServer(options)
sys.exit(1)
reftest.stopWebServer(options)
if __name__ == "__main__":

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

@ -345,8 +345,16 @@ def main():
if (dm.processExist(procName)):
dm.killProcess(procName)
sys.exit(mochitest.runTests(options))
try:
retVal = mochitest.runTests(options)
except:
print "TEST-UNEXPECTED-ERROR | | Exception caught while running tests."
mochitest.stopWebServer(options)
mochitest.stopWebSocketServer(options)
sys.exit(1)
sys.exit(retVal)
if __name__ == "__main__":
main()