5 # Copyright The SCons Foundation
7 # Permission is hereby granted, free of charge, to any person obtaining
8 # a copy of this software and associated documentation files (the
9 # "Software"), to deal in the Software without restriction, including
10 # without limitation the rights to use, copy, modify, merge, publish,
11 # distribute, sublicense, and/or sell copies of the Software, and to
12 # permit persons to whom the Software is furnished to do so, subject to
13 # the following conditions:
15 # The above copyright notice and this permission notice shall be included
16 # in all copies or substantial portions of the Software.
18 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
19 # KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
20 # WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
21 # NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
22 # LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
23 # OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
24 # WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 Verify that use of $JAVABOOTCLASSPATH sets the -bootclasspath option
28 on javac compilations.
35 test
= TestSCons
.TestSCons()
37 where_javac
, java_version
= test
.java_where_javac()
39 test
.write('SConstruct', """
40 DefaultEnvironment(tools=[])
41 env = Environment(tools=['javac'], JAVABOOTCLASSPATH=['dir1', 'dir2'])
42 j1 = env.Java(target='class', source='com/Example1.java')
43 j2 = env.Java(target='class', source='com/Example2.java')
48 test
.write(['com', 'Example1.java'], """\
54 public static void main(String[] args)
62 test
.write(['com', 'Example2.java'], """\
68 public static void main(String[] args)
76 # Setting -bootclasspath messes with the Java runtime environment, so
77 # we'll just take the easy way out and examine the -n output to see if
78 # the expected option shows up on the command line.
80 bootclasspath
= os
.pathsep
.join(['dir1', 'dir2'])
83 javac -bootclasspath %(bootclasspath)s -d class -sourcepath com com.Example1\\.java
84 javac -bootclasspath %(bootclasspath)s -d class -sourcepath com com.Example2\\.java
87 test
.run(arguments
= '-Q -n .', stdout
= expect
, match
=TestSCons
.match_re
)
93 # indent-tabs-mode:nil
95 # vim: set expandtab tabstop=4 shiftwidth=4: