Ejemplo n.º 1
0
    def test_simple(self):
        makefile = mock.Mock()
        obj = self.context['object_file']('main.o')

        result = self.context['executable']('exe', obj)
        link.make_link(result.creator, self.build, makefile, self.env)
        makefile.rule.assert_called_once_with(result, [obj], [], AlwaysEqual(),
                                              {}, None)
Ejemplo n.º 2
0
    def test_dir_sentinel(self):
        obj = self.context['object_file']('main.o')
        result = self.context['executable']('dir/exe', obj)

        makefile = make.Makefile(None)
        with mock.patch.object(make.Makefile, 'rule') as mrule:
            link.make_link(result.creator, self.build, makefile, self.env)
        mrule.assert_called_once_with(result, [obj], [Path('dir/.dir')],
                                      AlwaysEqual(), self._variables(), None)
Ejemplo n.º 3
0
    def test_extra_deps(self):
        makefile = 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.make_link(result.creator, self.build, makefile, self.env)
        makefile.rule.assert_called_once_with(result, [obj, dep], [],
                                              AlwaysEqual(), {}, None)
Ejemplo n.º 4
0
    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)

        makefile = make.Makefile(None)
        with mock.patch.object(make.Makefile, 'rule') as mrule:
            link.make_link(result.creator, self.build, makefile, self.env)
        mrule.assert_called_once_with(result, [obj, dep], [], AlwaysEqual(),
                                      self._variables(), None)