diff options
-rw-r--r-- | src/engine/SCons/Node/FS.py | 17 | ||||
-rw-r--r-- | test/AR/ARCOMSTR.py | 9 | ||||
-rw-r--r-- | test/RANLIB/RANLIBCOM.py | 5 | ||||
-rw-r--r-- | test/RANLIB/RANLIBCOMSTR.py | 5 |
4 files changed, 21 insertions, 15 deletions
diff --git a/src/engine/SCons/Node/FS.py b/src/engine/SCons/Node/FS.py index d9282ea..a0a7a44 100644 --- a/src/engine/SCons/Node/FS.py +++ b/src/engine/SCons/Node/FS.py @@ -1377,20 +1377,15 @@ class Dir(Base): 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__" diff --git a/test/AR/ARCOMSTR.py b/test/AR/ARCOMSTR.py index f20adb5..ae63ea0 100644 --- a/test/AR/ARCOMSTR.py +++ b/test/AR/ARCOMSTR.py @@ -30,6 +30,7 @@ the displayed archiver string. """ import TestSCons +import string python = TestSCons.python @@ -63,10 +64,10 @@ env.Library(target = 'output', source = ['file.1', 'file.2']) 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") diff --git a/test/RANLIB/RANLIBCOM.py b/test/RANLIB/RANLIBCOM.py index 25f2f61..d60a14e 100644 --- a/test/RANLIB/RANLIBCOM.py +++ b/test/RANLIB/RANLIBCOM.py @@ -34,6 +34,11 @@ python = TestSCons.python 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', """ diff --git a/test/RANLIB/RANLIBCOMSTR.py b/test/RANLIB/RANLIBCOMSTR.py index 4e348c0..4e03675 100644 --- a/test/RANLIB/RANLIBCOMSTR.py +++ b/test/RANLIB/RANLIBCOMSTR.py @@ -35,6 +35,11 @@ python = TestSCons.python 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', """ |