Beispiel #1
0
 def test_boolean_value_from_false_boolean_parameter(self):
     self.litConfig.params['enable_exceptions'] = False
     param = dsl.Parameter(name='enable_exceptions', choices=[True, False], type=bool, help='',
                           actions=lambda exceptions: [] if exceptions else [dsl.AddFeature("-fno-exceptions")])
     for a in param.getActions(self.config, self.litConfig.params):
         a.applyTo(self.config)
     self.assertIn('-fno-exceptions', self.config.available_features)
Beispiel #2
0
 def test_value_provided_on_command_line_and_no_default_value(self):
     self.litConfig.params['std'] = 'c++03'
     param = dsl.Parameter(name='std', choices=['c++03'], type=str, help='',
                           actions=lambda std: [dsl.AddFeature(std)])
     for a in param.getActions(self.config, self.litConfig.params):
         a.applyTo(self.config)
     self.assertIn('c++03', self.config.available_features)
Beispiel #3
0
 def test_value_provided_in_config_and_default_value(self):
     """The value provided in the config should override the default value"""
     self.config.std ='c++11'
     param = dsl.Parameter(name='std', choices=['c++03', 'c++11'], type=str, default='c++03', help='',
                           actions=lambda std: [dsl.AddFeature(std)])
     for a in param.getActions(self.config, self.litConfig.params):
         a.applyTo(self.config)
     self.assertIn('c++11', self.config.available_features)
     self.assertNotIn('c++03', self.config.available_features)