8054461: Add @file support to sjavac

Add @file support to sjavac commandline.

Reviewed-by: jjg, alundblad
This commit is contained in:
Fredrik Öhrström 2014-08-08 20:47:24 +02:00
parent 6b0a761ca3
commit ce6154a2fa
4 changed files with 40 additions and 12 deletions

View file

@ -25,7 +25,7 @@
/*
* @test
* @summary Test all aspects of sjavac.
* @bug 8004658 8042441 8042699
* @bug 8004658 8042441 8042699 8054461
*
* @build Wrapper
* @run main Wrapper SJavac
@ -99,6 +99,7 @@ public class SJavac {
compileCircularSources();
compileExcludingDependency();
incrementalCompileTestFullyQualifiedRef();
compileWithAtFile();
delete(gensrc);
delete(gensrc2);
@ -463,6 +464,37 @@ public class SJavac {
"bin/javac_state");
}
/**
* Tests @atfile
* @throws Exception If test fails
*/
void compileWithAtFile() throws Exception {
System.out.println("\nTest @atfile with command line content.");
System.out.println("---------------------------------------");
delete(gensrc);
delete(gensrc2);
delete(bin);
populate(gensrc,
"list.txt",
"-if */alfa/omega/A.java\n-if */beta/B.java\ngensrc\n-d bin\n",
"alfa/omega/A.java",
"package alfa.omega; import beta.B; public class A { B b; }",
"beta/B.java",
"package beta; public class B { }",
"beta/C.java",
"broken");
previous_bin_state = collectState(bin);
compile("@gensrc/list.txt", "--server:portfile=testserver,background=false");
Map<String,Long> new_bin_state = collectState(bin);
verifyThatFilesHaveBeenAdded(previous_bin_state, new_bin_state,
"bin/javac_state",
"bin/alfa/omega/A.class",
"bin/beta/B.class");
}
void removeFrom(Path dir, String... args) throws IOException {
for (String filename : args) {
Path p = dir.resolve(filename);