- Document the overlooked LIBPATH construction variable.
(Bug reported by Eicke Godehardt.)
+ - Fix so that Ignore() ignores indirect, implicit dependencies
+ (included files), not just direct dependencies.
+
From Anthony Roach:
- Make the scons script return an error code on failures.
assert node.scanned[ds] == 1, node.scanned
def test_children(self):
- """Test fetching the "children" of a Node.
- """
+ """Test fetching the non-ignored "children" of a Node.
+ """
node = SCons.Node.Node()
one = SCons.Node.Node()
two = SCons.Node.Node()
node.add_source([one, two, three])
node.add_dependency([four, five, six])
+ node.add_ignore([two, five])
kids = node.children()
+ assert len(kids) == 4
+ assert one in kids
+ assert not two in kids
+ assert three in kids
+ assert four in kids
+ assert not five in kids
+ assert six in kids
+
+ def test_all_children(self):
+ """Test fetching all the "children" of a Node.
+ """
+ node = SCons.Node.Node()
+ one = SCons.Node.Node()
+ two = SCons.Node.Node()
+ three = SCons.Node.Node()
+ four = SCons.Node.Node()
+ five = SCons.Node.Node()
+ six = SCons.Node.Node()
+
+ node.add_source([one, two, three])
+ node.add_dependency([four, five, six])
+ node.add_ignore([two, five])
+ kids = node.all_children()
assert len(kids) == 6
assert one in kids
assert two in kids
self.wkids.append(wkid)
def children(self):
+ """Return a list of the node's direct children, minus those
+ that are ignored by this node."""
+ return filter(lambda x, i=self.ignore: x not in i, self.all_children())
+
+ def all_children(self):
+ """Return a list of all the node's direct children."""
#XXX Need to remove duplicates from this
- return filter(lambda x, i=self.ignore: x not in i,
- self.sources \
- + self.depends \
- + reduce(lambda x, y: x + y, self.implicit.values(), []))
+ return self.sources \
+ + self.depends \
+ + reduce(lambda x, y: x + y, self.implicit.values(), [])
def get_parents(self):
return self.parents
# utility functions
-def get_children(node): return node.children()
+def get_children(node): return node.all_children()
def _scons_syntax_error(e):
"""Handle syntax errors. Print out a message and show where the error
self.path = file.path
self.builder = file.builder
self.depends = []
+ self.ignore = []
self.use_signature = 1
self.bsig = None
self.csig = None
return self.exists_cache
def children(self):
+ return filter(lambda x, i=self.ignore: x not in i,
+ self.sources + self.depends)
+
+ def all_children(self):
return self.sources + self.depends
def current(self):
self.bsig = bsig
self.csig = csig
self.kids = []
+ self.ignore = []
self.builder = None
self.use_signature = 1
def children(self):
+ return filter(lambda x, i=self.ignore: x not in i, self.kids)
+ def all_children(self):
return self.kids
def exists(self):
return 1
assert self.calc.bsig(n1) == 55
+ n1.ignore = [n2]
+
+ assert self.calc.bsig(n1) == 33
+
def test_Calc_bsig(self):
n = self.nodeclass('n', 11, 12)
# for us. Hence:
def walk_non_derived(n, myself=node):
if not n.builder or n is myself:
- return n.children()
+ return filter(lambda x, i=myself.ignore: x not in i,
+ n.all_children())
return []
walker = SCons.Node.Walker(node, walk_non_derived)
sigs = []