From ce9f09c5b8fa72b63e0f22cccb454430ef83f45f Mon Sep 17 00:00:00 2001 From: William Deegan Date: Wed, 26 Sep 2018 10:09:28 -0700 Subject: Speed up Install tests for windows --- test/Install/Clone.py | 1 + test/Install/INSTALLSTR.py | 3 ++- test/Install/Install.py | 3 ++- test/Install/InstallAs.py | 3 ++- test/Install/dir-exists.py | 1 + test/Install/directories.py | 4 +++- test/Install/multi-dir/src/SConstruct | 3 ++- test/Install/multi.py | 3 ++- test/Install/no-top-relative.py | 3 ++- test/Install/non-ascii-name.py | 1 + test/Install/option--install-sandbox.py | 3 ++- test/Install/tool.py | 1 + test/Install/wrap-by-attribute.py | 3 ++- 13 files changed, 23 insertions(+), 9 deletions(-) diff --git a/test/Install/Clone.py b/test/Install/Clone.py index da66157..14e0688 100644 --- a/test/Install/Clone.py +++ b/test/Install/Clone.py @@ -34,6 +34,7 @@ import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """ +DefaultEnvironment(tools=[]) env1 = Environment(DESTDIR='sub1', tools=[]) # Call env1.Install() but not env1.InstallAs() *before* we clone it. diff --git a/test/Install/INSTALLSTR.py b/test/Install/INSTALLSTR.py index 0cc5fce..145b81d 100644 --- a/test/Install/INSTALLSTR.py +++ b/test/Install/INSTALLSTR.py @@ -37,7 +37,8 @@ test = TestSCons.TestSCons() test.subdir('install') test.write('SConstruct', """\ -env = Environment(INSTALLSTR = 'INSTALL $SOURCE => $TARGET!') +DefaultEnvironment(tools=[]) +env = Environment(tools=[], INSTALLSTR = 'INSTALL $SOURCE => $TARGET!') env.Install('install', 'file') """) diff --git a/test/Install/Install.py b/test/Install/Install.py index 72a7545..da97d2a 100644 --- a/test/Install/Install.py +++ b/test/Install/Install.py @@ -48,6 +48,7 @@ f6_sep = f6_txt.replace(os.sep, '/') _SUBDIR_f4_out = os.path.join('$SUBDIR', 'f4.out') test.write(['work', 'SConstruct'], """\ +DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) f = open(target, "w") @@ -60,7 +61,7 @@ def my_install(dest, source, env): shutil.copy2(source, dest) open('my_install.out', 'a').write(dest) -env1 = Environment() +env1 = Environment(tools=[]) env1.Append(BUILDERS={'Cat':Builder(action=cat)}) env3 = env1.Clone(INSTALL = my_install) diff --git a/test/Install/InstallAs.py b/test/Install/InstallAs.py index 537ea3a..47ee9f6 100644 --- a/test/Install/InstallAs.py +++ b/test/Install/InstallAs.py @@ -47,7 +47,8 @@ _SUBDIR_file3_in = os.path.join('$SUBDIR', 'file3.in') # test.write('SConstruct', r""" -env = Environment(INSTALLDIR=r'%(install)s', SUBDIR='subdir') +DefaultEnvironment(tools=[]) +env = Environment(tools=[], INSTALLDIR=r'%(install)s', SUBDIR='subdir') InstallAs(r'%(install_file1_out)s', 'file1.in') env.InstallAs([r'%(_INSTALLDIR_file2_out)s', r'%(install_file3_out)s'], ['file2.in', r'%(_SUBDIR_file3_in)s']) diff --git a/test/Install/dir-exists.py b/test/Install/dir-exists.py index f981a35..9882d22 100644 --- a/test/Install/dir-exists.py +++ b/test/Install/dir-exists.py @@ -35,6 +35,7 @@ import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) Execute(Mkdir('a')) Execute(Mkdir('b')) f=Command('a/f', None, 'echo hi > $TARGET') diff --git a/test/Install/directories.py b/test/Install/directories.py index 74a7ac5..3ebc713 100644 --- a/test/Install/directories.py +++ b/test/Install/directories.py @@ -46,10 +46,12 @@ test.subdir('outside', ['work', 'dir4', 'sub']) test.write(['work', 'SConstruct'], """\ +DefaultEnvironment(tools=[]) +env = Environment(tools=[]) + Install('../outside', 'dir1') InstallAs('../outside/d2', 'dir2') -env = Environment() env.Install('../outside', 'dir3') env.InstallAs('../outside/d4', 'dir4') """) diff --git a/test/Install/multi-dir/src/SConstruct b/test/Install/multi-dir/src/SConstruct index e10ec8d..05b46a9 100644 --- a/test/Install/multi-dir/src/SConstruct +++ b/test/Install/multi-dir/src/SConstruct @@ -2,7 +2,8 @@ # outside the source tree can cause SCons to fail to create the dest # dir. import os, os.path, shutil -env=Environment() +DefaultEnvironment(tools=[]) +env=Environment(tools=[]) 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.py b/test/Install/multi.py index a7a6eb8..1716d17 100644 --- a/test/Install/multi.py +++ b/test/Install/multi.py @@ -34,7 +34,8 @@ import TestSCons test = TestSCons.TestSCons() test.write('SConstruct', """ -env = Environment() +DefaultEnvironment(tools=[]) +env = Environment(tools=[]) env.Install('install', 'file1') env.Install('install', 'file1') """) diff --git a/test/Install/no-top-relative.py b/test/Install/no-top-relative.py index 3eb24f7..31c7130 100644 --- a/test/Install/no-top-relative.py +++ b/test/Install/no-top-relative.py @@ -39,7 +39,8 @@ test = TestSCons.TestSCons() test.subdir(['test']) test.write(['SConstruct'], """\ -env = Environment() +DefaultEnvironment(tools=[]) +env = Environment(tools=[]) i = env.Install("#/install", "#/test/#testfile.txt#"); env.Default(i); """) diff --git a/test/Install/non-ascii-name.py b/test/Install/non-ascii-name.py index 186af09..462040d 100644 --- a/test/Install/non-ascii-name.py +++ b/test/Install/non-ascii-name.py @@ -39,6 +39,7 @@ test.write('中文.txt', "test stuff here in file 中文.txt.\n") test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) InstallAs("b", Glob("*.txt")) """) test.run(arguments='.') diff --git a/test/Install/option--install-sandbox.py b/test/Install/option--install-sandbox.py index 020cd3a..45366c1 100644 --- a/test/Install/option--install-sandbox.py +++ b/test/Install/option--install-sandbox.py @@ -49,7 +49,8 @@ file1_out = target+os.path.join( target, # test.write('SConstruct', r""" -env = Environment(SUBDIR='subdir') +DefaultEnvironment(tools=[]) +env = Environment(tools=[], SUBDIR='subdir') f1 = env.Install(r'%(destdir)s', 'file1.out') f2 = env.InstallAs(['file2.out', r'%(_SUBDIR_file3_out)s'], ['file2.in', r'%(_SUBDIR_file3_in)s']) diff --git a/test/Install/tool.py b/test/Install/tool.py index 1e49584..ba92d0a 100644 --- a/test/Install/tool.py +++ b/test/Install/tool.py @@ -36,6 +36,7 @@ test = TestSCons.TestSCons() test.subdir('iii') test.write('SConstruct', """ +DefaultEnvironment(tools=[]) env = Environment(tools = []) env.Install('iii', 'foo.in') env.InstallAs('foo.out', 'foo.in') diff --git a/test/Install/wrap-by-attribute.py b/test/Install/wrap-by-attribute.py index 02513af..6989fa8 100644 --- a/test/Install/wrap-by-attribute.py +++ b/test/Install/wrap-by-attribute.py @@ -42,6 +42,7 @@ test = TestSCons.TestSCons() test.subdir('outside', 'sub') test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) import os.path def cat(env, source, target): @@ -51,7 +52,7 @@ def cat(env, source, target): f.write(open(str(src), "rb").read()) f.close() -env = Environment(DESTDIR='dest') +env = Environment(tools=[], DESTDIR='dest') env.Append(BUILDERS={'Cat':Builder(action=cat)}) env.SconsInternalInstallFunc = env.Install -- cgit v0.12