Fix Bug #2622 - AlwaysBuild()+MSVC regression. Due to AlwaysBuild'd target not being...
authorWilliam Deegan <bill@baddogconsulting.com>
Sun, 20 Aug 2017 22:37:46 +0000 (15:37 -0700)
committerWilliam Deegan <bill@baddogconsulting.com>
Sun, 20 Aug 2017 22:37:46 +0000 (15:37 -0700)
src/CHANGES.txt
src/engine/SCons/ExecutorTests.py

index 47f74313b6973a9ebf7bec7a117a6413a8e13ed1..fa427265d8f69835717d2019fc1f6457e8373e3c 100644 (file)
@@ -38,6 +38,8 @@ may cause rebuilds.  In no case should rebuilds not happen.
     - Fixed Bug #3027 - "Cross Compiling issue: cannot override ranlib"
     - Fixed Bug #3020 - "Download link in user guide wrong. python setup.py install --version-lib broken"
     - Fixed Bug #2486 - Added SetOption('silent',True) - Previously this value was not allowed to be set.
+    - Fixed Bug #3040 - Non-unicode character in CHANGES.txt
+    - Fixed Bug #2622 - AlwaysBuild + MSVC regression.
 
   From Ibrahim Esmat:
     - Added the capability to build Windows Store Compatible libraries that can be used
index dbfb7d1634babd5f33578cd640afc07879015874..eeab3ada4c4fce31a036706988da0cd8e953c525 100644 (file)
@@ -74,8 +74,12 @@ class MyNode(object):
         self.pre_actions = pre
         self.post_actions = post
         self.missing_val = None
+        self.always_build = False
+        self.up_to_date = False
+
     def __str__(self):
         return self.name
+
     def build(self):
         executor = SCons.Executor.Executor(MyAction(self.pre_actions +
                                                     [self.builder.action] +
@@ -100,6 +104,9 @@ class MyNode(object):
     def disambiguate(self):
         return self
 
+    def is_up_to_date(self):
+        return self.up_to_date
+
 class MyScanner(object):
     def __init__(self, prefix):
         self.prefix = prefix
@@ -455,6 +462,24 @@ class ExecutorTestCase(unittest.TestCase):
         r = x.get_unignored_sources(None, [s1, s3])
         assert r == [s2], list(map(str, r))
 
+    def test_changed_sources_for_alwaysBuild(self):
+        """
+        Ensure if a target is marked always build that the sources are always marked changed sources
+        :return:
+        """
+        env = MyEnvironment()
+        s1 = MyNode('s1')
+        s2 = MyNode('s2')
+        t1 = MyNode('t1')
+        t1.up_to_date = True
+        t1.always_build = True
+
+        x = SCons.Executor.Executor('b', env, [{}], [t1], [s1, s2])
+
+        changed_sources = x._get_changed_sources()
+        assert changed_sources == [s1, s2], "If target marked AlwaysBuild sources should always be marked changed"
+
+
 
 
 if __name__ == "__main__":