Skip to content

Fix #4143: Ignore lines "Picked up _JAVA_OPTIONS" in tests #4239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 4, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/test/dotty/tools/vulpix/ChildJVMMain.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import java.lang.reflect.Method;

public class ChildJVMMain {
static final String MessageStart = "##THIS IS THE START FOR ME, HELLO##";
static final String MessageEnd = "##THIS IS THE END FOR ME, GOODBYE##";

private static void runMain(String dir) throws Exception {
Expand All @@ -23,6 +24,9 @@ private static void runMain(String dir) throws Exception {
Class<?> cls = ucl.loadClass("Test");
Method meth = cls.getMethod("main", String[].class);
Object[] args = new Object[]{ new String[]{ "jvm" } };

System.out.println(MessageStart);

meth.invoke(null, args);
}

Expand Down
8 changes: 7 additions & 1 deletion compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,13 @@ trait RunnerOrchestration {
if (childStdout eq null)
childStdout = new BufferedReader(new InputStreamReader(process.getInputStream))

var childOutput = childStdout.readLine()
var childOutput: String = childStdout.readLine()

// Discard all messages until the test starts
while (childOutput != ChildJVMMain.MessageStart && childOutput != null)
childOutput = childStdout.readLine()
childOutput = childStdout.readLine()

while (childOutput != ChildJVMMain.MessageEnd && childOutput != null) {
sb.append(childOutput)
sb += '\n'
Expand Down