diff options
author | William Deegan <bill@baddogconsulting.com> | 2018-10-01 03:36:37 (GMT) |
---|---|---|
committer | William Deegan <bill@baddogconsulting.com> | 2018-10-01 03:36:37 (GMT) |
commit | a2f51f139090e67233f05b0067ca7f885db09a8a (patch) | |
tree | ef0461811992be4ab8d81835e180ea4edd2e05f5 /test/Java/JAR.py | |
parent | 9f1422fbe3487c4a8b82249881ba93d800733056 (diff) | |
download | SCons-a2f51f139090e67233f05b0067ca7f885db09a8a.zip SCons-a2f51f139090e67233f05b0067ca7f885db09a8a.tar.gz SCons-a2f51f139090e67233f05b0067ca7f885db09a8a.tar.bz2 |
Switch to depending on javac tool finding javac on win32 rather than the test infrastructure. JavaCommon now has reasonable defaults for windows java sdk installs
Diffstat (limited to 'test/Java/JAR.py')
-rw-r--r-- | test/Java/JAR.py | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/test/Java/JAR.py b/test/Java/JAR.py index faf01a3..4703a28 100644 --- a/test/Java/JAR.py +++ b/test/Java/JAR.py @@ -26,6 +26,7 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__" import os import TestSCons +import sys _python_ = TestSCons._python_ @@ -119,22 +120,13 @@ test.run(arguments='classes.jar') test.must_match('classes.jar', 'cvfm classes.jar foo.mf -C testdir bar.class\n', mode='r') - - -where_javac, java_version = test.java_where_javac() -where_jar = test.java_where_jar() - - - test.file_fixture('wrapper_with_args.py') test.write('SConstruct', """ DefaultEnvironment(tools=[]) -foo = Environment(tools = ['javac', 'jar'], - JAVAC = r'%(where_javac)s', - JAR = r'%(where_jar)s') -jar = foo.Dictionary('JAR') -bar = foo.Clone(JAR = r'%(_python_)s wrapper_with_args.py ' + jar) +foo = Environment(tools = ['javac', 'jar']) +# jar = foo.Dictionary('JAR') +bar = foo.Clone(JAR = r'%(_python_)s wrapper_with_args.py jar') foo.Java(target = 'classes', source = 'com/sub/foo') bar.Java(target = 'classes', source = 'com/sub/bar') foo.Jar(target = 'foo', source = 'classes/com/sub/foo') @@ -232,7 +224,7 @@ public class Example6 test.run(arguments = '.') -expected_wrapper_out = "wrapper_with_args.py %(where_jar)s cf bar.jar classes/com/sub/bar\n" +expected_wrapper_out = "wrapper_with_args.py jar cf bar.jar classes/com/sub/bar\n" expected_wrapper_out = expected_wrapper_out.replace('/', os.sep) test.must_match('wrapper.out', expected_wrapper_out % locals(), mode='r') @@ -313,10 +305,12 @@ public class JavaFile3 test.run(chdir='testdir2') # check the output and make sure the java files got converted to classes -if("jar cf foo.jar " + - "-C com/javasource/JavaFile1 com/javasource/JavaFile1.class " + - "-C com/javasource/JavaFile2 com/javasource/JavaFile2.class " + - "-C com/javasource/JavaFile3 com/javasource/JavaFile3.class" not in test.stdout()): +compare_string = "jar cf foo.jar -C com/javasource/JavaFile1 com/javasource/JavaFile1.class -C com/javasource/JavaFile2 com/javasource/JavaFile2.class -C com/javasource/JavaFile3 com/javasource/JavaFile3.class" + +if sys.platform == 'win32': + compare_string = compare_string.replace('/','\\') + +if(compare_string not in test.stdout()): test.fail_test() #test single target jar |