author Rafael Ávila de Espíndola <>
Thu, 01 Sep 2011 12:19:06 -0400
changeset 77452 11247af82311ed6d6fc2bc19782fc978ee0aca48
parent 34223 5cbe1e28ffb559b274c33af885f04597025f7b99
child 98529 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Bug 680277 - Debug builds should always be compiled with frame pointers. r=khuey. This patch creates a new MOZ_FRAMEPTR_FLAGS variable that is used only to control the frame pointer flags passed to the compiler. It also computes this flag in a macro so that the toplevel configure and js/src/configure stay in sync.

from unittest import TextTestRunner as _TestRunner, TestResult as _TestResult
import inspect

'''Helper to make python unit tests report the way that the Mozilla
unit test infrastructure expects tests to report.


import unittest
from mozunit import MozTestRunner

if __name__ == '__main__':

class _MozTestResult(_TestResult):
    def __init__(self, stream, descriptions):
        _TestResult.__init__(self) = stream
        self.descriptions = descriptions

    def getDescription(self, test):
        if self.descriptions:
            return test.shortDescription() or str(test)
            return str(test)

    def addSuccess(self, test):
        _TestResult.addSuccess(self, test)
        filename = inspect.getfile(test.__class__)
        testname = test._testMethodName"TEST-PASS | %s | %s" % (filename, testname))

    def addError(self, test, err):
        _TestResult.addError(self, test, err)
        self.printFail(test, err)

    def addFailure(self, test, err):
        _TestResult.addFailure(self, test, err)

    def printFail(self, test, err):
        exctype, value, tb = err
        # Skip test runner traceback levels
        while tb and self._is_relevant_tb_level(tb):
            tb = tb.tb_next
        if not tb:
        _f, _ln, _t = inspect.getframeinfo(tb)[:3]"TEST-UNEXPECTED-FAIL | %s | line %d, %s: %s" % 
                            (_f, _ln, _t, value.message))

    def printErrorList(self):
        for test, err in self.errors:
  "ERROR: %s" % self.getDescription(test))
  "%s" % err)

class MozTestRunner(_TestRunner):
    def _makeResult(self):
        return _MozTestResult(, self.descriptions)
    def run(self, test):
        result = self._makeResult()
        return result