summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/ExecutorTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-03-30 04:05:49 (GMT)
committerSteven Knight <knight@baldmt.com>2005-03-30 04:05:49 (GMT)
commitf8e0d6d523f37a813eae06bc1d3a24cf49aa8d49 (patch)
tree9dec3695f4cf3969c873046f459ffa3e46f33500 /src/engine/SCons/ExecutorTests.py
parentf1914d9d169bec36cfc5be72baea3b8dacb78f23 (diff)
downloadSCons-f8e0d6d523f37a813eae06bc1d3a24cf49aa8d49.zip
SCons-f8e0d6d523f37a813eae06bc1d3a24cf49aa8d49.tar.gz
SCons-f8e0d6d523f37a813eae06bc1d3a24cf49aa8d49.tar.bz2
Make sure scans are added to all targets in a builder call, to prevent out-of-order -j builds.
Diffstat (limited to 'src/engine/SCons/ExecutorTests.py')
-rw-r--r--src/engine/SCons/ExecutorTests.py41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/engine/SCons/ExecutorTests.py b/src/engine/SCons/ExecutorTests.py
index d16b137..62c1eab 100644
--- a/src/engine/SCons/ExecutorTests.py
+++ b/src/engine/SCons/ExecutorTests.py
@@ -310,22 +310,43 @@ class ExecutorTestCase(unittest.TestCase):
ts = x.get_timestamp()
assert ts == 0, ts
- def test_scan(self):
+ def test_scan_targets(self):
+ """Test scanning the targets for implicit dependencies"""
+ env = MyEnvironment(S='string')
+ t1 = MyNode('t1')
+ t2 = MyNode('t2')
+ sources = [MyNode('s1'), MyNode('s2')]
+ x = SCons.Executor.Executor('b', env, [{}], [t1, t2], sources)
+
+ deps = x.scan_targets(None)
+ assert t1.implicit == ['dep-t1', 'dep-t2'], t1.implicit
+ assert t2.implicit == ['dep-t1', 'dep-t2'], t2.implicit
+
+ t1.implicit = []
+ t2.implicit = []
+
+ deps = x.scan_targets(MyScanner('scanner-'))
+ assert t1.implicit == ['scanner-t1', 'scanner-t2'], t1.implicit
+ assert t2.implicit == ['scanner-t1', 'scanner-t2'], t2.implicit
+
+ def test_scan_sources(self):
"""Test scanning the sources for implicit dependencies"""
env = MyEnvironment(S='string')
- targets = [MyNode('t')]
+ t1 = MyNode('t1')
+ t2 = MyNode('t2')
sources = [MyNode('s1'), MyNode('s2')]
- x = SCons.Executor.Executor('b', env, [{}], targets, sources)
+ x = SCons.Executor.Executor('b', env, [{}], [t1, t2], sources)
- deps = x.scan(None)
- t = targets[0]
- assert t.implicit == ['dep-s1', 'dep-s2'], t.implicit
+ deps = x.scan_sources(None)
+ assert t1.implicit == ['dep-s1', 'dep-s2'], t1.implicit
+ assert t2.implicit == ['dep-s1', 'dep-s2'], t2.implicit
- t.implicit = []
+ t1.implicit = []
+ t2.implicit = []
- deps = x.scan(MyScanner('scanner-'))
- t = targets[0]
- assert t.implicit == ['scanner-s1', 'scanner-s2'], t.implicit
+ deps = x.scan_sources(MyScanner('scanner-'))
+ assert t1.implicit == ['scanner-s1', 'scanner-s2'], t1.implicit
+ assert t2.implicit == ['scanner-s1', 'scanner-s2'], t2.implicit
def test_get_missing_sources(self):
"""Test the ability to check if any sources are missing"""