"""
return filter(lambda s: s.missing(), self.sources)
- def get_source_binfo(self, calc):
+ def get_source_binfo(self, calc, ignore=[]):
"""
+ Return three lists, one of the source files, one of their
+ calculated signatures, and one of their strings (path names).
__cacheable__
"""
+ sourcelist = self.sources
+ if ignore:
+ sourcelist = filter(lambda s, i=ignore: not s in i, sourcelist)
calc_signature = lambda node, calc=calc: node.calc_signature(calc)
- return map(lambda s, c=calc_signature: (s, c(s), str(s)), self.sources)
+ return (sourcelist,
+ map(calc_signature, sourcelist),
+ map(str, sourcelist))
pass
def get_missing_sources(self):
return []
- def get_source_binfo(self, calc):
- return []
+ def get_source_binfo(self, calc, ignore=[]):
+ return ([], [], [])
def test_get_source_binfo(self):
"""Test fetching the build signature info for the sources"""
env = MyEnvironment()
- targets = [MyNode('t')]
- sources = [MyNode('s1'), MyNode('s2')]
- x = SCons.Executor.Executor('b', env, [{}], targets, sources)
+ t1 = MyNode('t')
+ s1 = MyNode('s1')
+ s2 = MyNode('s2')
+ x = SCons.Executor.Executor('b', env, [{}], [t1], [s1, s2])
+
b = x.get_source_binfo('C')
- assert b == [(sources[0], 'cs-C-s1', 's1'),
- (sources[1], 'cs-C-s2', 's2')], b
+ assert b == ([s1, s2],
+ ['cs-C-s1', 'cs-C-s2'],
+ ['s1', 's2']), b
+
+ b = x.get_source_binfo('C', [s1])
+ assert b == ([s2],
+ ['cs-C-s2'],
+ ['s2']), b
+
+ b = x.get_source_binfo('C', [s2])
+ assert b == ([s1],
+ ['cs-C-s1'],
+ ['s1']), b
executor = self.get_executor()
- sourcelist = executor.get_source_binfo(calc)
+ sourcelist, sourcesigs, bsources = executor.get_source_binfo(calc, self.ignore)
depends = self.depends
implicit = self.implicit or []
if self.ignore:
- sourcelist = filter(lambda t, s=self: s.do_not_ignore(t[0]), sourcelist)
depends = filter(self.do_not_ignore, depends)
implicit = filter(self.do_not_ignore, implicit)
def calc_signature(node, calc=calc):
return node.calc_signature(calc)
- sourcesigs = map(lambda t: t[1], sourcelist)
dependsigs = map(calc_signature, depends)
implicitsigs = map(calc_signature, implicit)
binfo.bactsig = calc.module.signature(executor)
sigs.append(binfo.bactsig)
- binfo.bsources = map(lambda t: t[2], sourcelist)
+ binfo.bsources = bsources
binfo.bdepends = map(str, depends)
binfo.bimplicit = map(str, implicit)