self.presub = presub
def __cmp__(self, other):
- return cmp(self.__dict__, other.__dict__)
+ return cmp(self.__dict__, other)
def print_cmd_line(self, s, target, source, env):
sys.stdout.write(s + "\n")
name = bar.get_name(env)
assert name == 'BAR', name
+ def test_3_dict_names(self):
+ """Test Action/Suffix dicts with get_name.
+
+ Verifies that Action/Suffix dictionaries work correctly,
+ especially two builders that can generate the same suffix,
+ where one of the builders has a suffix dictionary with a None
+ key."""
+
+ foo = SCons.Builder.Builder(action = '$FOO', suffix = '.foo')
+ bar = SCons.Builder.Builder(action = {}, suffix={None:'.bar'})
+ bar.add_action('.cow', "$MOO")
+ dog = SCons.Builder.Builder(suffix = '.bar')
+
+ env = Environment( BUILDERS = {'FOO' : foo,
+ 'BAR' : bar,
+ 'DOG' : dog} )
+
+ assert foo.get_name(env) == 'FOO'
+ assert bar.get_name(env) == 'BAR'
+ assert dog.get_name(env) == 'DOG'
+
if __name__ == "__main__":
suite = unittest.TestSuite()