Bug 645826: Include standard output and standard error in exception text when testing manifest conditions. r=dmandelin
authorJim Blandy <jimb@mozilla.com>
Wed, 30 Mar 2011 12:49:47 -0700
changeset 64553 b55ca8a7c0ade1a42e8460f3156062e542daf5f1
parent 64552 1e5ded29dd9f2c15c9fa2453e844832217417b28
child 64554 aba14034d8197dbc28a106680c8cd3e88ba0d7f1
push idunknown
push userunknown
push dateunknown
reviewersdmandelin
bugs645826
milestone2.2a1pre
Bug 645826: Include standard output and standard error in exception text when testing manifest conditions. r=dmandelin
js/src/tests/manifest.py
--- a/js/src/tests/manifest.py
+++ b/js/src/tests/manifest.py
@@ -71,17 +71,19 @@ class XULInfoTester:
             cmd = [ self.js_bin, '-e', self.js_prolog, '-e', 'print(!!(%s))'%cond ]
             p = Popen(cmd, stdin=PIPE, stdout=PIPE, stderr=PIPE)
             out, err = p.communicate()
             if out in ('true\n', 'true\r\n'):
                 ans = True
             elif out in ('false\n', 'false\r\n'):
                 ans = False
             else:
-                raise Exception("Failed to test XUL condition '%s'"%cond)
+                raise Exception(("Failed to test XUL condition %r;"
+                                 + " output was %r, stderr was %r")
+                                 % (cond, out, err))
             self.cache[cond] = ans
         return ans
 
 class NullXULInfoTester:
     """Can be used to parse manifests without a JS shell."""
     def test(self, cond):
         return False