Bug 1269517 - Outfit the configure tests' fake compiler to handle compilation calls. r=glandium draft
authorChris Manchester <cmanchester@mozilla.com>
Fri, 22 Jul 2016 10:39:36 -0700
changeset 391395 0a429bd1a48b4d4eb9954a76a64f8fc3c7d1ba45
parent 391394 dc35e9900926d7557f8b62b87c50b0c2d24add68
child 391396 6d03954a4b14b0ffdde29886bdb774dfc06db0bf
push id23897
push usercmanchester@mozilla.com
push dateFri, 22 Jul 2016 17:39:54 +0000
reviewersglandium
bugs1269517
milestone50.0a1
Bug 1269517 - Outfit the configure tests' fake compiler to handle compilation calls. r=glandium MozReview-Commit-ID: 80kwRjHUJb9
python/mozbuild/mozbuild/test/configure/test_toolchain_helpers.py
--- a/python/mozbuild/mozbuild/test/configure/test_toolchain_helpers.py
+++ b/python/mozbuild/mozbuild/test/configure/test_toolchain_helpers.py
@@ -185,16 +185,20 @@ class FakeCompiler(dict):
                     apply_defn(defn)
 
             for flag in flags:
                 apply_defn(self.get(flag, {}))
 
             pp.out = StringIO()
             pp.do_include(file)
             return 0, pp.out.getvalue(), ''
+        elif '-c' in flags:
+            if '-funknown-flag' in flags:
+                return 1, '', ''
+            return 0, '', ''
 
         return 1, '', ''
 
     def __add__(self, other):
         return FakeCompiler(self, other)
 
 
 class TestFakeCompiler(unittest.TestCase):