From 5fcf75e653d4fe5cd0f171635ee569902d041549 Mon Sep 17 00:00:00 2001 From: Mats Wichmann Date: Fri, 28 Jan 2022 06:39:16 -0700 Subject: Java not-in-path tests use limited tools There's no reason for these tests to initialize all tools since only checking for one. During development of unrelated PR #4088 these two failed initializing gcc tool - might as well run as lean as possible. Signed-off-by: Mats Wichmann --- SCons/Tool/jar.py | 2 +- test/Java/jar_not_in_PATH.py | 3 ++- test/Java/rmic_not_in_PATH.py | 8 +++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/SCons/Tool/jar.py b/SCons/Tool/jar.py index 3a75be7..ae44ff3 100644 --- a/SCons/Tool/jar.py +++ b/SCons/Tool/jar.py @@ -105,7 +105,7 @@ def Jar(env, target=None, source=[], *args, **kw): # jar target should not be a list so assume they passed # no target and want implicit target to be made and the arg # was actaully the list of sources - if SCons.Util.is_List(target) and source is []: + if SCons.Util.is_List(target) and source == []: SCons.Warnings.warn( SCons.Warnings.SConsWarning, "Making implicit target jar file, and treating the list as sources" diff --git a/test/Java/jar_not_in_PATH.py b/test/Java/jar_not_in_PATH.py index 05bb9c8..b890ba1 100644 --- a/test/Java/jar_not_in_PATH.py +++ b/test/Java/jar_not_in_PATH.py @@ -41,7 +41,8 @@ test.write('SConstruct', """\ import os oldpath = os.environ.get('PATH', '') -env = Environment(ENV={'PATH': ['.']}) +DefaultEnvironment(tools=[]) +env = Environment(ENV={'PATH': ['.']}, tools=['javac', 'jar']) env['ENV']['PATH'] = oldpath env['JAR'] = r'%(_python_)s ./myjar.py' env.Jar(target='test1.jar', source='test1.class') diff --git a/test/Java/rmic_not_in_PATH.py b/test/Java/rmic_not_in_PATH.py index ac3f28e..68a2c30 100644 --- a/test/Java/rmic_not_in_PATH.py +++ b/test/Java/rmic_not_in_PATH.py @@ -63,11 +63,13 @@ sys.exit(0) test.write('SConstruct', """ import os -oldpath = os.environ.get('PATH','') -env = Environment(ENV = {'PATH' : ['.']}) + +oldpath = os.environ.get('PATH', '') +DefaultEnvironment(tools=[]) +env = Environment(ENV={'PATH': ['.']}, tools=['javac', 'rmic']) env['ENV']['PATH'] = oldpath env['RMIC'] = r'%(_python_)s myrmic.py' -env.RMIC(target = 'outdir', source = 'test1.java') +env.RMIC(target='outdir', source='test1.java') """ % locals()) test.write('test1.java', """\ -- cgit v0.12