From 95ea6b9cf4253a153e26a4553533bd0eaa28295a Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Wed, 16 Nov 2022 07:02:49 -0700 Subject: A few more e2e test speedups adding DefaultEnvironment calls with no tools Signed-off-by: Mats Wichmann --- test/Alias/action.py | 8 ++++---- test/CPPPATH/CPPPATH.py | 1 + test/CacheDir/option--cs.py | 4 +++- test/Fortran/F77PATH.py | 3 +++ test/Fortran/F90PATH.py | 2 ++ test/Fortran/FORTRANPATH.py | 4 ++++ testing/framework/TestSCons.py | 2 ++ 7 files changed, 19 insertions(+), 5 deletions(-) diff --git a/test/Alias/action.py b/test/Alias/action.py index def27a7..8212448 100644 --- a/test/Alias/action.py +++ b/test/Alias/action.py @@ -1,6 +1,8 @@ #!/usr/bin/env python # -# __COPYRIGHT__ +# 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 @@ -20,14 +22,11 @@ # 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 that Aliases with actions work. """ -__revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" - import TestSCons test = TestSCons.TestSCons() @@ -52,6 +51,7 @@ def bar(target, source, env): with open('bar', 'wb') as f: f.write(bytearray("bar(%s, %s)\\n" % (target, source),'utf-8')) +DefaultEnvironment(tools=[]) # test speedup env = Environment(BUILDERS = {'Cat':Builder(action=cat)}) env.Alias(target = ['build-f1'], source = 'f1.out', action = foo) f1 = env.Cat('f1.out', 'f1.in') diff --git a/test/CPPPATH/CPPPATH.py b/test/CPPPATH/CPPPATH.py index 8e9bda8..73e0e09 100644 --- a/test/CPPPATH/CPPPATH.py +++ b/test/CPPPATH/CPPPATH.py @@ -246,6 +246,7 @@ test.up_to_date(arguments = args) # Change CPPPATH and make sure we don't rebuild because of it. test.write('SConstruct', """ +DefaultEnvironment(tools=[]) # test speedup env = Environment(CPPPATH = Split('inc2 include ${TARGET.dir} ${SOURCE.dir}')) obj = env.Object(target='foobar/prog', source='subdir/prog.c') env.Program(target='prog', source=obj) diff --git a/test/CacheDir/option--cs.py b/test/CacheDir/option--cs.py index a2b09ed..c3e5e5b 100644 --- a/test/CacheDir/option--cs.py +++ b/test/CacheDir/option--cs.py @@ -54,7 +54,6 @@ with open(sys.argv[1], 'w') as f: cache = test.workpath('cache') test.write(['src1', 'SConstruct'], """ -DefaultEnvironment(tools=[]) def cat(env, source, target): target = str(target[0]) with open('cat.out', 'a') as f: @@ -63,6 +62,8 @@ def cat(env, source, target): for src in source: with open(str(src), "r") as f2: f.write(f2.read()) + +DefaultEnvironment(tools=[]) # test speedup env = Environment(tools=[], BUILDERS={'Internal':Builder(action=cat), 'External':Builder(action=r'%(_python_)s build.py $TARGET $SOURCES')}) @@ -156,6 +157,7 @@ hello_obj = 'hello' + _obj src2_hello = test.workpath('src2', hello_exe) test.write(['src2', 'SConstruct'], """ +DefaultEnvironment(tools=[]) # test speedup env = Environment() env.Program('hello.c') CacheDir(r'%s') diff --git a/test/Fortran/F77PATH.py b/test/Fortran/F77PATH.py index e594978..cce5f13 100644 --- a/test/Fortran/F77PATH.py +++ b/test/Fortran/F77PATH.py @@ -46,6 +46,7 @@ if not test.detect_tool(fc): test.subdir('include', 'subdir', ['subdir', 'include'], 'foobar', 'inc2') test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) # test speedup env = Environment( F77='%s', F77PATH=['$FOO', '${TARGET.dir}', '${SOURCE.dir}'], @@ -226,6 +227,7 @@ test.up_to_date(arguments = args) # Change F77PATH and make sure we don't rebuild because of it. test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) # test speedup env = Environment( F77='%s', F77PATH=Split('inc2 include ${TARGET.dir} ${SOURCE.dir}'), @@ -285,6 +287,7 @@ test.up_to_date(arguments = args) # Check that a null-string F77PATH doesn't blow up. test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) # test speedup env = Environment(tools=['%s'], F77PATH='', F77FLAGS='-x f77') env.Object('foo', source='empty.f77') """ % fc) diff --git a/test/Fortran/F90PATH.py b/test/Fortran/F90PATH.py index 58c6c90..c10e134 100644 --- a/test/Fortran/F90PATH.py +++ b/test/Fortran/F90PATH.py @@ -46,6 +46,7 @@ if not test.detect_tool(fc): test.subdir('include', 'subdir', ['subdir', 'include'], 'foobar', 'inc2') test.write('SConstruct', """ +DefaultEnvironment(tools=[]) # test speedup env = Environment( F90=r'%s', F90PATH=['$FOO', '${TARGET.dir}', '${SOURCE.dir}'], @@ -228,6 +229,7 @@ test.up_to_date(arguments = args) # Change F90PATH and make sure we don't rebuild because of it. test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) # test speedup env = Environment( F90=r'%s', F90PATH=Split('inc2 include ${TARGET.dir} ${SOURCE.dir}'), diff --git a/test/Fortran/FORTRANPATH.py b/test/Fortran/FORTRANPATH.py index 3a62c45..f0f8b3e 100644 --- a/test/Fortran/FORTRANPATH.py +++ b/test/Fortran/FORTRANPATH.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +# # MIT License # # Copyright The SCons Foundation @@ -45,6 +46,7 @@ if not test.detect_tool(fc): test.subdir('include', 'subdir', ['subdir', 'include'], 'foobar', 'inc2') test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) # test speedup env = Environment( FORTRAN='%s', FORTRANPATH=['$FOO', '${TARGET.dir}', '${SOURCE.dir}'], @@ -241,6 +243,7 @@ test.up_to_date(arguments = args) # Change FORTRANPATH and make sure we don't rebuild because of it. test.write('SConstruct', """\ +DefaultEnvironment(tools=[]) # test speedup env = Environment( FORTRAN='%s', FORTRANPATH=Split('inc2 include ${TARGET.dir} ${SOURCE.dir}'), @@ -304,6 +307,7 @@ test.up_to_date(arguments = args) # Check that a null-string FORTRANPATH doesn't blow up. test.write('SConstruct', """ +DefaultEnvironment(tools=[]) # test speedup env = Environment(FORTRANPATH = '') env.Object('foo', source = 'empty.f') """) diff --git a/testing/framework/TestSCons.py b/testing/framework/TestSCons.py index 18b9193..dea9ab5 100644 --- a/testing/framework/TestSCons.py +++ b/testing/framework/TestSCons.py @@ -1159,6 +1159,7 @@ void my_qt_symbol(const char *arg) { self.write([dir, 'lib', 'SConstruct'], r""" import sys +DefaultEnvironment(tools=[]) # test speedup env = Environment() if sys.platform == 'win32': env.StaticLibrary('myqt', 'my_qobject.cpp') @@ -1185,6 +1186,7 @@ if ARGUMENTS.get('noqtdir', 0): QTDIR = None else: QTDIR = r'%s' +DefaultEnvironment(tools=[]) # test speedup env = Environment( QTDIR=QTDIR, QT_LIB=r'%s', QT_MOC=r'%s', QT_UIC=r'%s', tools=['default', 'qt'] ) -- cgit v0.12