Bug 1136841 - Fix rungtests.py to check for crashes in the correct directory. r=ahal
authorChris Manchester <cmanchester@mozilla.com>
Thu, 07 Jan 2016 12:27:10 -0800
changeset 279059 c2b1901fba11e5dc36ea070f9179d7676a85221d
parent 279058 21b1103b8b11ac6d7ac884f74413d66a8330b42c
child 279060 39220ff4899b5614e2da063687efd6c8147a0e97
push id29867
push usercbook@mozilla.com
push dateFri, 08 Jan 2016 11:00:43 +0000
treeherdermozilla-central@1424cdfc075d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersahal
bugs1136841
milestone46.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1136841 - Fix rungtests.py to check for crashes in the correct directory. r=ahal
testing/gtest/rungtests.py
--- a/testing/gtest/rungtests.py
+++ b/testing/gtest/rungtests.py
@@ -18,17 +18,17 @@ import mozprocess
 log = mozlog.unstructured.getLogger('gtest')
 
 class GTests(object):
     # Time (seconds) to wait for test process to complete
     TEST_PROC_TIMEOUT = 1200
     # Time (seconds) in which process will be killed if it produces no output.
     TEST_PROC_NO_OUTPUT_TIMEOUT = 300
 
-    def run_gtest(self, prog, xre_path, symbols_path=None, cwd=None):
+    def run_gtest(self, prog, xre_path, cwd, symbols_path=None):
         """
         Run a single C++ unit test program.
 
         Arguments:
         * prog: The path to the test program to run.
         * env: The environment to use for running the program.
         * symbols_path: A path to a directory containing Breakpad-formatted
                         symbol files for producing stack traces on crash.
@@ -48,17 +48,17 @@ class GTests(object):
         #TODO: After bug 811320 is fixed, don't let .run() kill the process,
         # instead use a timeout in .wait() and then kill to get a stack.
         proc.run(timeout=GTests.TEST_PROC_TIMEOUT,
                  outputTimeout=GTests.TEST_PROC_NO_OUTPUT_TIMEOUT)
         proc.wait()
         if proc.timedOut:
             log.testFail("gtest | timed out after %d seconds", GTests.TEST_PROC_TIMEOUT)
             return False
-        if mozcrash.check_for_crashes(os.getcwd(), symbols_path, test_name="gtest"):
+        if mozcrash.check_for_crashes(cwd, symbols_path, test_name="gtest"):
             # mozcrash will output the log failure line for us.
             return False
         result = proc.proc.returncode == 0
         if not result:
             log.testFail("gtest | test failed with return code %d", proc.proc.returncode)
         return result
 
     def build_core_environment(self, env = {}):
@@ -148,18 +148,18 @@ def main():
     if not options.xre_path:
         print >>sys.stderr, """Error: --xre-path is required"""
         sys.exit(1)
     prog = os.path.abspath(args[0])
     options.xre_path = os.path.abspath(options.xre_path)
     tester = GTests()
     try:
         result = tester.run_gtest(prog, options.xre_path,
-                                  symbols_path=options.symbols_path,
-                                  cwd=options.cwd)
+                                  options.cwd,
+                                  symbols_path=options.symbols_path)
     except Exception, e:
         log.error(str(e))
         result = False
     sys.exit(0 if result else 1)
 
 if __name__ == '__main__':
     main()