pass
def current(self, calc=None):
- """If all of our children were up-to-date, then this
- directory was up-to-date, too."""
+ """If any child is not up-to-date, then this directory isn't,
+ either."""
if not self.builder is MkdirBuilder and not self.exists():
return 0
- state = 0
+ up_to_date = SCons.Node.up_to_date
for kid in self.children():
- s = kid.get_state()
- if s and (not state or s > state):
- state = s
- import SCons.Node
- if state == 0 or state == SCons.Node.up_to_date:
- return 1
- else:
- return 0
+ if kid.get_state() > up_to_date:
+ return 0
+ return 1
def rdir(self):
"__cacheable__"
"""
import TestSCons
+import string
python = TestSCons.python
test.write('file.1', "file.1\n/*ar*/\n")
test.write('file.2', "file.2\n/*ar*/\n")
-test.run(stdout = test.wrap_stdout("""\
-Archiving output.lib from file.1 file.2
-%s myranlib.py output.lib
-""" % python))
+test.run()
+
+expect = 'Archiving output.lib from file.1 file.2'
+test.fail_test(string.find(test.stdout(), expect) == -1)
test.must_match('output.lib', "file.1\nfile.2\n")
test = TestSCons.TestSCons()
+ranlib = test.detect('RANLIB', 'ranlib')
+
+if not ranlib:
+ test.skip_test("Could not find 'ranlib', skipping test.\n")
+
test.write('myar.py', """
test = TestSCons.TestSCons()
+ranlib = test.detect('RANLIB', 'ranlib')
+
+if not ranlib:
+ test.skip_test("Could not find 'ranlib', skipping test.\n")
+
test.write('myar.py', """