def test_simple(self): ninjafile = mock.Mock() obj = self.context['object_file']('main.o') result = self.context['executable']('exe', obj) link.ninja_link(result.creator, self.build, ninjafile, self.env) ninjafile.build.assert_called_once_with(output=[result], rule='cc_link', inputs=[obj], implicit=[], variables={})
def test_extra_deps(self): dep = self.context['generic_file']('dep.txt') obj = self.context['object_file']('main.o') result = self.context['executable']('exe', obj, extra_deps=dep) ninjafile = ninja.NinjaFile(None) with mock.patch.object(ninja.NinjaFile, 'build') as mbuild: link.ninja_link(result.creator, self.build, ninjafile, self.env) mbuild.assert_called_once_with( output=[result], rule='cc_link', inputs=[obj], implicit=[dep], variables=self._variables() )
def test_extra_deps(self): ninjafile = mock.Mock() dep = self.context['generic_file']('dep.txt') obj = self.context['object_file']('main.o') result = self.context['executable']('exe', obj, extra_deps=dep) link.ninja_link(result.creator, self.build, ninjafile, self.env) ninjafile.build.assert_called_once_with(output=[result], rule='cc_link', inputs=[obj], implicit=[dep], variables={})