summaryrefslogtreecommitdiffstats
path: root/test/Java/JAVAC.py
diff options
context:
space:
mode:
authorWilliam Deegan <bill@baddogconsulting.com>2022-02-01 19:12:46 (GMT)
committerGitHub <noreply@github.com>2022-02-01 19:12:46 (GMT)
commit6789d9b6467158229d0eb8044cafc37014e8942d (patch)
tree6429c5d6d3e15e73646c45e08786c247b8d05356 /test/Java/JAVAC.py
parentde52cc83605dd49eb2f0a72dfb74a948735555bc (diff)
parent9cfc3e65cc14dbffc16da5a1ba31c6695dbbacdf (diff)
downloadSCons-6789d9b6467158229d0eb8044cafc37014e8942d.zip
SCons-6789d9b6467158229d0eb8044cafc37014e8942d.tar.gz
SCons-6789d9b6467158229d0eb8044cafc37014e8942d.tar.bz2
Merge branch 'SCons:master' into fix_py_3_9_resourceWarnings
Diffstat (limited to 'test/Java/JAVAC.py')
-rw-r--r--test/Java/JAVAC.py42
1 files changed, 8 insertions, 34 deletions
diff --git a/test/Java/JAVAC.py b/test/Java/JAVAC.py
index 20f7f96..f303e87 100644
--- a/test/Java/JAVAC.py
+++ b/test/Java/JAVAC.py
@@ -25,6 +25,8 @@
"""
Test setting the JAVAC variable.
+
+This test does not require a JDK to operate.
"""
import os
@@ -35,33 +37,11 @@ _python_ = TestSCons._python_
test = TestSCons.TestSCons()
+test.file_fixture(['Java-fixture', 'myjavac.py'])
-
-test.write('myjavac.py', r"""
-import sys
-args = sys.argv[1:]
-while args:
- a = args[0]
- if a == '-d':
- args = args[1:]
- elif a == '-sourcepath':
- args = args[1:]
- else:
- break
- args = args[1:]
-for file in args:
- infile = open(file, 'r')
- outfile = open(file[:-5] + '.class', 'w')
- for l in infile.readlines():
- if l[:9] != '/*javac*/':
- outfile.write(l)
-sys.exit(0)
-""")
-
-test.write('SConstruct', """
-env = Environment(tools = ['javac'],
- JAVAC = r'%(_python_)s myjavac.py')
-env.Java(target = '.', source = '.')
+test.write('SConstruct', """\
+env = Environment(tools=['javac'], JAVAC=r'%(_python_)s myjavac.py')
+env.Java(target='.', source='.')
""" % locals())
test.write('test1.java', """\
@@ -71,15 +51,12 @@ line 3
""")
test.run(arguments='.', stderr=None)
-
test.must_match('test1.class', "test1.java\nline 3\n", mode='r')
if os.path.normcase('.java') == os.path.normcase('.JAVA'):
-
test.write('SConstruct', """\
-env = Environment(tools = ['javac'],
- JAVAC = r'%(_python_)s myjavac.py')
-env.Java(target = '.', source = '.')
+env = Environment(tools=['javac'], JAVAC=r'%(_python_)s myjavac.py')
+env.Java(target='.', source='.')
""" % locals())
test.write('test2.JAVA', """\
@@ -89,11 +66,8 @@ line 3
""")
test.run(arguments='.', stderr=None)
-
test.must_match('test2.class', "test2.JAVA\nline 3\n", mode='r')
-
-
test.pass_test()
# Local Variables: