summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/ExecutorTests.py
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-04-01 22:58:50 (GMT)
committerSteven Knight <knight@baldmt.com>2005-04-01 22:58:50 (GMT)
commitc378212a5904028315760269a52272a3eb025dca (patch)
tree57e7a2d7d0628b81827df9b05e1cfeafff1c0b04 /src/engine/SCons/ExecutorTests.py
parentb4e1ccf877aecd44b8d865a06c57dd950e3344ae (diff)
downloadSCons-c378212a5904028315760269a52272a3eb025dca.zip
SCons-c378212a5904028315760269a52272a3eb025dca.tar.gz
SCons-c378212a5904028315760269a52272a3eb025dca.tar.bz2
Store source file and dependency paths relative to the target's directory, not relative to the top-level SConstruct directory.
Diffstat (limited to 'src/engine/SCons/ExecutorTests.py')
-rw-r--r--src/engine/SCons/ExecutorTests.py51
1 files changed, 32 insertions, 19 deletions
diff --git a/src/engine/SCons/ExecutorTests.py b/src/engine/SCons/ExecutorTests.py
index 62c1eab..9ff30e5 100644
--- a/src/engine/SCons/ExecutorTests.py
+++ b/src/engine/SCons/ExecutorTests.py
@@ -358,28 +358,41 @@ class ExecutorTestCase(unittest.TestCase):
missing = x.get_missing_sources()
assert missing == [sources[0]], missing
- def test_get_source_binfo(self):
- """Test fetching the build signature info for the sources"""
+ def test_get_unignored_sources(self):
+ """Test fetching the unignored source list"""
env = MyEnvironment()
- 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 == ([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
+ s3 = MyNode('s3')
+ x = SCons.Executor.Executor('b', env, [{}], [], [s1, s2, s3])
+
+ r = x.get_unignored_sources([])
+ assert r == [s1, s2, s3], map(str, r)
+
+ r = x.get_unignored_sources([s2])
+ assert r == [s1, s3], map(str, r)
+
+ r = x.get_unignored_sources([s1, s3])
+ assert r == [s2], map(str, r)
+
+ def test_process_sources(self):
+ """Test processing the source list through a function"""
+ env = MyEnvironment()
+ s1 = MyNode('s1')
+ s2 = MyNode('s2')
+ s3 = MyNode('s3')
+ x = SCons.Executor.Executor('b', env, [{}], [], [s1, s2, s3])
+
+ r = x.process_sources(str)
+ assert r == ['s1', 's2', 's3'], r
+
+ r = x.process_sources(str, [s2])
+ assert r == ['s1', 's3'], r
+
+ def xxx(x):
+ return 'xxx-' + str(x)
+ r = x.process_sources(xxx, [s1, s3])
+ assert r == ['xxx-s2'], r