summaryrefslogtreecommitdiffstats
path: root/src/engine/SCons/EnvironmentTests.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine/SCons/EnvironmentTests.py')
-rw-r--r--src/engine/SCons/EnvironmentTests.py80
1 files changed, 4 insertions, 76 deletions
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index d4e6bc5..20c1eac 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -2204,16 +2204,16 @@ f5: \
exc_caught = None
try:
env.Tool('does_not_exist')
- except SCons.Errors.UserError:
+ except SCons.Errors.EnvironmentError:
exc_caught = 1
- assert exc_caught, "did not catch expected UserError"
+ assert exc_caught, "did not catch expected EnvironmentError"
exc_caught = None
try:
env.Tool('$NONE')
- except SCons.Errors.UserError:
+ except SCons.Errors.EnvironmentError:
exc_caught = 1
- assert exc_caught, "did not catch expected UserError"
+ assert exc_caught, "did not catch expected EnvironmentError"
# Use a non-existent toolpath directory just to make sure we
# can call Tool() with the keyword argument.
@@ -2821,78 +2821,6 @@ def generate(env):
assert i.__class__.__name__ == 'Dir', i.__class__.__name__
assert i.path == 'dir2'
- def test_Install(self):
- """Test the Install method"""
- env = self.TestEnvironment(FOO='iii', BAR='jjj')
-
- tgt = env.Install('export', [ 'build/foo1', 'build/foo2' ])
- paths = map(str, tgt)
- paths.sort()
- expect = map(os.path.normpath, [ 'export/foo1', 'export/foo2' ])
- assert paths == expect, paths
- for tnode in tgt:
- assert tnode.builder == InstallBuilder
-
- tgt = env.Install('$FOO', [ 'build/${BAR}1', 'build/${BAR}2' ])
- paths = map(str, tgt)
- paths.sort()
- expect = map(os.path.normpath, [ 'iii/jjj1', 'iii/jjj2' ])
- assert paths == expect, paths
- for tnode in tgt:
- assert tnode.builder == InstallBuilder
-
- tgt = env.Install('export', 'build')
- paths = map(str, tgt)
- paths.sort()
- expect = [os.path.join('export', 'build')]
- assert paths == expect, paths
- for tnode in tgt:
- assert tnode.builder == InstallBuilder
-
- tgt = env.Install('export', ['build', 'build/foo1'])
- paths = map(str, tgt)
- paths.sort()
- expect = [
- os.path.join('export', 'build'),
- os.path.join('export', 'foo1'),
- ]
- assert paths == expect, paths
- for tnode in tgt:
- assert tnode.builder == InstallBuilder
-
- tgt = env.Install('export', 'subdir/#file')
- assert str(tgt[0]) == os.path.normpath('export/#file'), str(tgt[0])
-
- env.File('export/foo1')
-
- exc_caught = None
- try:
- tgt = env.Install('export/foo1', 'build/foo1')
- except SCons.Errors.UserError, e:
- exc_caught = 1
- assert exc_caught, "UserError should be thrown reversing the order of Install() targets."
- expect = "Target `export/foo1' of Install() is a file, but should be a directory. Perhaps you have the Install() arguments backwards?"
- assert str(e) == expect, e
-
- def test_InstallAs(self):
- """Test the InstallAs method"""
- env = self.TestEnvironment(FOO='iii', BAR='jjj')
-
- tgt = env.InstallAs(target=string.split('foo1 foo2'),
- source=string.split('bar1 bar2'))
- assert len(tgt) == 2, len(tgt)
- paths = map(lambda x: str(x.sources[0]), tgt)
- paths.sort()
- expect = map(os.path.normpath, [ 'bar1', 'bar2' ])
- assert paths == expect, paths
- for tnode in tgt:
- assert tnode.builder == InstallBuilder
-
- tgt = env.InstallAs(target='${FOO}.t', source='${BAR}.s')[0]
- assert tgt.path == 'iii.t'
- assert tgt.sources[0].path == 'jjj.s'
- assert tgt.builder == InstallBuilder
-
def test_Literal(self):
"""Test the Literal() method"""
env = self.TestEnvironment(FOO='fff', BAR='bbb')