diff options
author | Gary Oberbrunner <garyo@genarts.com> | 2018-01-05 19:03:31 (GMT) |
---|---|---|
committer | Gary Oberbrunner <garyo@genarts.com> | 2018-01-05 19:12:39 (GMT) |
commit | 25887d95760e9e4ac65f8bbde3a99a0b3a1d471a (patch) | |
tree | d1ac77219834117edd2bfd6d7c05fdecfd2269c6 /test/Install | |
parent | 91d11918ad131c816dd481b82ca90b6aa15dc56b (diff) | |
download | SCons-25887d95760e9e4ac65f8bbde3a99a0b3a1d471a.zip SCons-25887d95760e9e4ac65f8bbde3a99a0b3a1d471a.tar.gz SCons-25887d95760e9e4ac65f8bbde3a99a0b3a1d471a.tar.bz2 |
Fix problem with Install and multiple dirs outside src tree.
In some cases it's possible to get a case where the target
path already does exist, but the dir node for it hasn't been
updated yet. This fix prevents MkdirFunc from trying to create
it when it already exists. Added a testcase which failed before
the fix and works after it.
Also fixes a problem running tests on Windows, using standard
python 3 which is installed in "C:/Program Files/Python36".
The python path name has to be escaped in that case. See runtest.py.
Diffstat (limited to 'test/Install')
-rw-r--r-- | test/Install/multi-dir.py | 41 | ||||
-rw-r--r-- | test/Install/multi-dir/src/SConstruct | 8 | ||||
-rw-r--r-- | test/Install/multi-dir/src/a/b/abfile | 0 | ||||
-rw-r--r-- | test/Install/multi-dir/src/x/y/xyfile | 0 |
4 files changed, 49 insertions, 0 deletions
diff --git a/test/Install/multi-dir.py b/test/Install/multi-dir.py new file mode 100644 index 0000000..ddb6d0a --- /dev/null +++ b/test/Install/multi-dir.py @@ -0,0 +1,41 @@ +#!/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__" + +""" +Verify that using Install to create multiple dir hierarchies outside +the source tree works. +""" + +import TestSCons +# _python_ = TestSCons._python_ + +test = TestSCons.TestSCons() +test.dir_fixture('multi-dir') +# Expect failure if bug exists, success if it's fixed +test.run(arguments="-C src ..") +test.must_exist('build/__foo/bar/baz/a/b/abfile') +test.must_exist('build/__foo/bar/baz/a/b/y/xyfile') +test.pass_test() diff --git a/test/Install/multi-dir/src/SConstruct b/test/Install/multi-dir/src/SConstruct new file mode 100644 index 0000000..e10ec8d --- /dev/null +++ b/test/Install/multi-dir/src/SConstruct @@ -0,0 +1,8 @@ +# This tests for a bug where installing a sequence dirs and subdirs +# outside the source tree can cause SCons to fail to create the dest +# dir. +import os, os.path, shutil +env=Environment() +dst='../build' +env.Install(os.path.join(dst,'__foo/bar/baz'), 'a') +env.Install(os.path.join(dst,'__foo/bar/baz/a/b'), 'x/y') diff --git a/test/Install/multi-dir/src/a/b/abfile b/test/Install/multi-dir/src/a/b/abfile new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Install/multi-dir/src/a/b/abfile diff --git a/test/Install/multi-dir/src/x/y/xyfile b/test/Install/multi-dir/src/x/y/xyfile new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/test/Install/multi-dir/src/x/y/xyfile |