summaryrefslogtreecommitdiffstats
path: root/test/SideEffect
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2018-04-11 02:27:45 (GMT)
committerWilliam Deegan <bill@baddogconsulting.com>2018-04-11 02:27:45 (GMT)
commite650cc43946737b9d950049ae9964064ea4bf33f (patch)
tree6089ed2545cefcf96302ee4dddcdc65f67fd2ab9 /test/SideEffect
parent20927b42ed4f0cb87f51287fa3b4b6cf915afcf8 (diff)
downloadSCons-e650cc43946737b9d950049ae9964064ea4bf33f.zip
SCons-e650cc43946737b9d950049ae9964064ea4bf33f.tar.gz
SCons-e650cc43946737b9d950049ae9964064ea4bf33f.tar.bz2
Fix for issue 3013 (and duplicate 3018). From bitbucket PR: https://bitbucket.org/scons/scons/pull-requests/303
Diffstat (limited to 'test/SideEffect')
-rw-r--r--test/SideEffect/Issues/3013/files/SConscript5
-rw-r--r--test/SideEffect/Issues/3013/files/SConstruct21
-rw-r--r--test/SideEffect/Issues/3013/files/test.cpp2
-rw-r--r--test/SideEffect/Issues/3013/sideffect_with_variantdir.py49
4 files changed, 77 insertions, 0 deletions
diff --git a/test/SideEffect/Issues/3013/files/SConscript b/test/SideEffect/Issues/3013/files/SConscript
new file mode 100644
index 0000000..27da7bb
--- /dev/null
+++ b/test/SideEffect/Issues/3013/files/SConscript
@@ -0,0 +1,5 @@
+Import('env')
+
+primary = env.make_file('output', 'test.cpp')
+this_causes_problems = env.SideEffect('output_side_effect', 'output')
+
diff --git a/test/SideEffect/Issues/3013/files/SConstruct b/test/SideEffect/Issues/3013/files/SConstruct
new file mode 100644
index 0000000..d01a4b7
--- /dev/null
+++ b/test/SideEffect/Issues/3013/files/SConstruct
@@ -0,0 +1,21 @@
+env = Environment()
+
+def make_file(target, source, env):
+ with open(str(target[0]), 'w') as f:
+ f.write('gobldygook')
+ with open(str(target[0]) + '_side_effect', 'w') as side_effect:
+ side_effect.write('anything')
+
+env.Append(
+ BUILDERS={'make_file': Builder(action=Action(make_file))}
+)
+
+env.objdir = 'build'
+
+SConscript(
+ 'SConscript',
+ variant_dir=env.objdir,
+ exports={'env':env},
+ duplicate=0
+)
+
diff --git a/test/SideEffect/Issues/3013/files/test.cpp b/test/SideEffect/Issues/3013/files/test.cpp
new file mode 100644
index 0000000..27424b0
--- /dev/null
+++ b/test/SideEffect/Issues/3013/files/test.cpp
@@ -0,0 +1,2 @@
+void some_function() {}
+
diff --git a/test/SideEffect/Issues/3013/sideffect_with_variantdir.py b/test/SideEffect/Issues/3013/sideffect_with_variantdir.py
new file mode 100644
index 0000000..9ca3eca
--- /dev/null
+++ b/test/SideEffect/Issues/3013/sideffect_with_variantdir.py
@@ -0,0 +1,49 @@
+#!/usr/bin/env python
+#
+# __COPYRIGHT__
+#
+# 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.
+#
+
+__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
+
+"""
+Test materials for Github Issue 3013 submitted by Stefan Ross:
+https://github.com/SCons/scons/issues/3013
+"""
+
+import TestSCons
+
+test = TestSCons.TestSCons()
+
+test.dir_fixture('files')
+
+test.run(
+ arguments = '-j2'
+)
+
+test.pass_test()
+
+# Local Variables:
+# tab-width:4
+# indent-tabs-mode:nil
+# End:
+# vim: set expandtab tabstop=4 shiftwidth=4:
+