equal
deleted
inserted
replaced
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
20 * or visit www.oracle.com if you need additional information or have any |
20 * or visit www.oracle.com if you need additional information or have any |
21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /** |
25 * @test |
25 * @test |
26 * @bug 8192920 8204588 |
26 * @bug 8192920 8204588 |
27 * @summary Test source mode |
27 * @summary Test source mode |
28 * @modules jdk.compiler jdk.jlink |
28 * @modules jdk.compiler jdk.jlink |
29 * @run main SourceMode |
29 * @run main SourceMode |
296 |
296 |
297 // #!.../java --source N -version |
297 // #!.../java --source N -version |
298 @Test |
298 @Test |
299 void testTerminalOptionInShebang() throws IOException { |
299 void testTerminalOptionInShebang() throws IOException { |
300 starting("testTerminalOptionInShebang"); |
300 starting("testTerminalOptionInShebang"); |
301 if (skipShebangTest || isMacOSX || isSolaris) { |
301 if (skipShebangTest || isAIX || isMacOSX || isSolaris) { |
302 // On MacOSX, we cannot distinguish between terminal options on the |
302 // On MacOSX, we cannot distinguish between terminal options on the |
303 // shebang line and those on the command line. |
303 // shebang line and those on the command line. |
304 // On Solaris, all options after the first on the shebang line are |
304 // On Solaris, all options after the first on the shebang line are |
305 // ignored. |
305 // ignored. Similar on AIX. |
306 log.println("SKIPPED"); |
306 log.println("SKIPPED"); |
307 return; |
307 return; |
308 } |
308 } |
309 Path base = Files.createDirectories( |
309 Path base = Files.createDirectories( |
310 Paths.get("testTerminalOptionInShebang")); |
310 Paths.get("testTerminalOptionInShebang")); |
320 |
320 |
321 // #!.../java --source N @bad.at (contains -version) |
321 // #!.../java --source N @bad.at (contains -version) |
322 @Test |
322 @Test |
323 void testTerminalOptionInShebangAtFile() throws IOException { |
323 void testTerminalOptionInShebangAtFile() throws IOException { |
324 starting("testTerminalOptionInShebangAtFile"); |
324 starting("testTerminalOptionInShebangAtFile"); |
325 if (skipShebangTest || isMacOSX || isSolaris) { |
325 if (skipShebangTest || isAIX || isMacOSX || isSolaris) { |
326 // On MacOSX, we cannot distinguish between terminal options in a |
326 // On MacOSX, we cannot distinguish between terminal options in a |
327 // shebang @-file and those on the command line. |
327 // shebang @-file and those on the command line. |
328 // On Solaris, all options after the first on the shebang line are |
328 // On Solaris, all options after the first on the shebang line are |
329 // ignored. |
329 // ignored. Similar on AIX. |
330 log.println("SKIPPED"); |
330 log.println("SKIPPED"); |
331 return; |
331 return; |
332 } |
332 } |
333 // Use a short directory name, to avoid line length limitations |
333 // Use a short directory name, to avoid line length limitations |
334 Path base = Files.createDirectories(Paths.get("testBadAtFile")); |
334 Path base = Files.createDirectories(Paths.get("testBadAtFile")); |
347 |
347 |
348 // #!.../java --source N HelloWorld |
348 // #!.../java --source N HelloWorld |
349 @Test |
349 @Test |
350 void testMainClassInShebang() throws IOException { |
350 void testMainClassInShebang() throws IOException { |
351 starting("testMainClassInShebang"); |
351 starting("testMainClassInShebang"); |
352 if (skipShebangTest || isMacOSX || isSolaris) { |
352 if (skipShebangTest || isAIX || isMacOSX || isSolaris) { |
353 // On MacOSX, we cannot distinguish between a main class on the |
353 // On MacOSX, we cannot distinguish between a main class on the |
354 // shebang line and one on the command line. |
354 // shebang line and one on the command line. |
355 // On Solaris, all options after the first on the shebang line are |
355 // On Solaris, all options after the first on the shebang line are |
356 // ignored. |
356 // ignored. Similar on AIX. |
357 log.println("SKIPPED"); |
357 log.println("SKIPPED"); |
358 return; |
358 return; |
359 } |
359 } |
360 Path base = Files.createDirectories(Paths.get("testMainClassInShebang")); |
360 Path base = Files.createDirectories(Paths.get("testMainClassInShebang")); |
361 Path bad = base.resolve("bad"); |
361 Path bad = base.resolve("bad"); |