Prepare side-effect nodes before building, too. (Charles Crain)
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 6 Dec 2003 14:02:46 +0000 (14:02 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Sat, 6 Dec 2003 14:02:46 +0000 (14:02 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@856 fdb21ef1-2011-0410-befe-b5e4ea1792b1

src/CHANGES.txt
src/engine/SCons/Taskmaster.py
src/engine/SCons/TaskmasterTests.py

index c9a4ad6eb2094fadc8445546e4c29ef50efbe85c..b95cfc03b10d68602658f9661e8abe3bf71e86fb 100644 (file)
@@ -43,6 +43,9 @@ RELEASE 0.95 - XXX
     values.  Previously, SCons would only use the values if all three
     were set in the registry.
 
+  - Make sure side-effect nodes are prepare()d before building their
+    corresponding target.
+
   From Scott Lystig Fritchie:
 
   - Fix the ability to use a custom _concat() function in the
index b269fa2e65033c1f1accad0d8869ae1535058500..90d14528fb2ecce95080f7fb83f0fc112d6b77ab 100644 (file)
@@ -81,6 +81,8 @@ class Task:
 
         for t in self.targets:
             t.prepare()
+            for s in t.side_effects:
+                s.prepare()
 
     def execute(self):
         """Called to execute the task.
index fd21891e1186f692c4660eef4dcf6e757062d738..019611a69c5d217127ad4e6950f1601611ac9386 100644 (file)
@@ -627,6 +627,28 @@ class TaskmasterTestCase(unittest.TestCase):
         assert str(e) == "exception value", e
         assert built_text is None, built_text
 
+        # Regression test, make sure we prepare not only
+        # all targets, but their side effects as well.
+        n6 = Node("n6")
+        n7 = Node("n7")
+        n8 = Node("n8")
+        n9 = Node("n9")
+        n10 = Node("n10")
+
+        n6.side_effects = [ n8 ]
+        n7.side_effects = [ n9, n10 ]
+        
+        tm = SCons.Taskmaster.Taskmaster([n6, n7])
+        t = tm.next_task()
+        # More bogus reaching in and setting the targets.
+        t.targets = [n6, n7]
+        t.prepare()
+        assert n6.prepared
+        assert n7.prepared
+        assert n8.prepared
+        assert n9.prepared
+        assert n10.prepared
+
     def test_execute(self):
         """Test executing a task