Bug 1259683 - Forgotten change to test_configure.py before landing bug 1257823. r=nalexander
authorMike Hommey <mh+mozilla@glandium.org>
Fri, 25 Mar 2016 15:54:00 +0900
changeset 290542 e2fe62b540c6f41b67921e8479cb0f8adf83ce43
parent 290541 174b56d80f690f0d34c4ac19d2cc0a06a5a05266
child 290543 98fd214bd3f2c3f6b78484c8c19a5f7c84aca880
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersnalexander
bugs1259683, 1257823
milestone48.0a1
Bug 1259683 - Forgotten change to test_configure.py before landing bug 1257823. r=nalexander This was suggested during review, and was applied to 2 of the 3 patches where this applied, and the imply_option tests were left out. This fixes it.
python/mozbuild/mozbuild/test/configure/test_configure.py
--- a/python/mozbuild/mozbuild/test/configure/test_configure.py
+++ b/python/mozbuild/mozbuild/test/configure/test_configure.py
@@ -321,97 +321,101 @@ class TestConfigure(unittest.TestCase):
         self.assertEquals(config['DEFINES'], {'BAR': False})
 
         with self.assertRaises(ConfigureError):
             # Both --set-foo and --set-name=FOO are going to try to
             # set_define('FOO'...)
             get_config(['--set-foo', '--set-name=FOO'])
 
     def test_imply_option_simple(self):
-        config = self.get_config([], configure='imply_option/simple.configure')
+        def get_config(*args):
+            return self.get_config(
+                *args, configure='imply_option/simple.configure')
+
+        config = get_config([])
         self.assertEquals(config, {})
 
-        config = self.get_config(['--enable-foo'],
-                                 configure='imply_option/simple.configure')
+        config = get_config(['--enable-foo'])
         self.assertIn('BAR', config)
         self.assertEquals(config['BAR'], PositiveOptionValue())
 
         with self.assertRaises(InvalidOptionError) as e:
-            config = self.get_config(['--enable-foo', '--disable-bar'],
-                                     configure='imply_option/simple.configure')
+            get_config(['--enable-foo', '--disable-bar'])
 
         self.assertEquals(
             e.exception.message,
             "'--enable-bar' implied by '--enable-foo' conflicts with "
             "'--disable-bar' from the command-line")
 
     def test_imply_option_negative(self):
-        config = self.get_config([],
-                                 configure='imply_option/negative.configure')
+        def get_config(*args):
+            return self.get_config(
+                *args, configure='imply_option/negative.configure')
+
+        config = get_config([])
         self.assertEquals(config, {})
 
-        config = self.get_config(['--enable-foo'],
-                                 configure='imply_option/negative.configure')
+        config = get_config(['--enable-foo'])
         self.assertIn('BAR', config)
         self.assertEquals(config['BAR'], NegativeOptionValue())
 
         with self.assertRaises(InvalidOptionError) as e:
-            config = self.get_config(
-                ['--enable-foo', '--enable-bar'],
-                configure='imply_option/negative.configure')
+            get_config(['--enable-foo', '--enable-bar'])
 
         self.assertEquals(
             e.exception.message,
             "'--disable-bar' implied by '--enable-foo' conflicts with "
             "'--enable-bar' from the command-line")
 
-        config = self.get_config(['--disable-hoge'],
-                                 configure='imply_option/negative.configure')
+        config = get_config(['--disable-hoge'])
         self.assertIn('BAR', config)
         self.assertEquals(config['BAR'], NegativeOptionValue())
 
         with self.assertRaises(InvalidOptionError) as e:
-            config = self.get_config(
-                ['--disable-hoge', '--enable-bar'],
-                configure='imply_option/negative.configure')
+            get_config(['--disable-hoge', '--enable-bar'])
 
         self.assertEquals(
             e.exception.message,
             "'--disable-bar' implied by '--disable-hoge' conflicts with "
             "'--enable-bar' from the command-line")
 
     def test_imply_option_values(self):
-        config = self.get_config([], configure='imply_option/values.configure')
+        def get_config(*args):
+            return self.get_config(
+                *args, configure='imply_option/values.configure')
+
+        config = get_config([])
         self.assertEquals(config, {})
 
-        config = self.get_config(['--enable-foo=a'],
-                                 configure='imply_option/values.configure')
+        config = get_config(['--enable-foo=a'])
         self.assertIn('BAR', config)
         self.assertEquals(config['BAR'], PositiveOptionValue(('a',)))
 
-        config = self.get_config(['--enable-foo=a,b'],
-                                 configure='imply_option/values.configure')
+        config = get_config(['--enable-foo=a,b'])
         self.assertIn('BAR', config)
         self.assertEquals(config['BAR'], PositiveOptionValue(('a','b')))
 
         with self.assertRaises(InvalidOptionError) as e:
-            config = self.get_config(['--enable-foo=a,b', '--disable-bar'],
-                                     configure='imply_option/values.configure')
+            get_config(['--enable-foo=a,b', '--disable-bar'])
 
         self.assertEquals(
             e.exception.message,
             "'--enable-bar=a,b' implied by '--enable-foo' conflicts with "
             "'--disable-bar' from the command-line")
 
     def test_imply_option_infer(self):
-        config = self.get_config([], configure='imply_option/infer.configure')
+        def get_config(*args):
+            return self.get_config(
+                *args, configure='imply_option/infer.configure')
+
+        config = get_config([])
+        self.assertEquals(config, {})
 
         with self.assertRaises(InvalidOptionError) as e:
-            config = self.get_config(['--enable-foo', '--disable-bar'],
-                                     configure='imply_option/infer.configure')
+            get_config(['--enable-foo', '--disable-bar'])
 
         self.assertEquals(
             e.exception.message,
             "'--enable-bar' implied by '--enable-foo' conflicts with "
             "'--disable-bar' from the command-line")
 
         with self.assertRaises(ConfigureError) as e:
             self.get_config([], configure='imply_option/infer_ko.configure')