From 3930d06d0de1acbf2261dcf14b27cd6b060c112a Mon Sep 17 00:00:00 2001 From: "jwalden@mit.edu" Date: Tue, 6 May 2008 10:40:41 -0700 Subject: [PATCH] Bug 431900 - Add a commandline flag to make assertions fatal, for easy use in tinderbox scripts and the like, especially if we eventually set up a run of all the tests that don't trigger assertions and then run them with this argument specified. r=sayrer, a=testonlychange --- testing/mochitest/runtests.py.in | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/testing/mochitest/runtests.py.in b/testing/mochitest/runtests.py.in index 9d61667feae..0b2f751b4f9 100644 --- a/testing/mochitest/runtests.py.in +++ b/testing/mochitest/runtests.py.in @@ -175,6 +175,12 @@ class MochitestOptions(optparse.OptionParser): "than the given number") defaults["leakThreshold"] = 1.0e3000 + self.add_option("--fatal-assertions", + action = "store_true", dest = "fatalAssertions", + help = "abort testing whenever an assertion is hit " + "(requires a debug build to be effective)") + defaults["fatalAssertions"] = False + # -h, --help are automatically handled by OptionParser self.set_defaults(**defaults) @@ -333,6 +339,9 @@ Are you executing $objdir/_tests/testing/mochitest/runtests.py?""" browserEnv["XPCOM_MEM_BLOAT_LOG"] = LEAK_REPORT_FILE + if options.fatalAssertions: + browserEnv["XPCOM_DEBUG_BREAK"] = "stack-and-abort" + start = automation.runApp(testURL, browserEnv, options.app, PROFILE_DIRECTORY, options.browserArgs)