summaryrefslogtreecommitdiffstats
path: root/test/Progress
diff options
context:
space:
mode:
authorDaniel Moody <daniel.moody@mongodb.com>2021-04-09 16:07:00 (GMT)
committerDaniel Moody <daniel.moody@mongodb.com>2021-04-09 16:07:00 (GMT)
commit4750a25645153ee3978684d8f694d868a0bbe0d0 (patch)
tree09024f58ab4eec2d4204495d9fa42cf11731a038 /test/Progress
parent4fc9442705394359b79df6472cd570ea68e03826 (diff)
downloadSCons-4750a25645153ee3978684d8f694d868a0bbe0d0.zip
SCons-4750a25645153ee3978684d8f694d868a0bbe0d0.tar.gz
SCons-4750a25645153ee3978684d8f694d868a0bbe0d0.tar.bz2
Fixed issue with multi-target nodes being passed to the progress object.
Diffstat (limited to 'test/Progress')
-rw-r--r--test/Progress/multi-target.py47
-rw-r--r--test/Progress/multi_target_fixture/SConstruct9
-rw-r--r--test/Progress/multi_target_fixture/in.txt0
3 files changed, 56 insertions, 0 deletions
diff --git a/test/Progress/multi-target.py b/test/Progress/multi-target.py
new file mode 100644
index 0000000..f25bce1
--- /dev/null
+++ b/test/Progress/multi-target.py
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+#
+# MIT License
+#
+# Copyright The SCons Foundation
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be included
+# in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
+# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+"""
+Test to make sure multitarget progress receives status on all target nodes.
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.dir_fixture('multi_target_fixture')
+
+test.run(arguments='out2.txt -Q')
+
+test.must_contain_exactly_lines(test.stdout(), ['out1.txt', 'out2.txt'])
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4: \ No newline at end of file
diff --git a/test/Progress/multi_target_fixture/SConstruct b/test/Progress/multi_target_fixture/SConstruct
new file mode 100644
index 0000000..646217e
--- /dev/null
+++ b/test/Progress/multi_target_fixture/SConstruct
@@ -0,0 +1,9 @@
+class ProgressTest:
+
+ def __call__(self, node):
+ if node.get_state() == 2:
+ print(node)
+
+env = Environment(tools=[])
+env.Command(target=['out1.txt', 'out2.txt'], source=['in.txt'], action=Action('echo $SOURCE > ${TARGETS[0]};echo $SOURCE > ${TARGETS[1]}', None))
+Progress(ProgressTest()) \ No newline at end of file
diff --git a/test/Progress/multi_target_fixture/in.txt b/test/Progress/multi_target_fixture/in.txt
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/test/Progress/multi_target_fixture/in.txt