Skip to content

Commit ffa2a74

Browse files
committed
Fix #4143: Ignore lines printed before the start of the test
1 parent 5f3b57a commit ffa2a74

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

compiler/test/dotty/tools/vulpix/ChildJVMMain.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
import java.lang.reflect.Method;
1010

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

1415
private static void runMain(String dir) throws Exception {
@@ -23,6 +24,9 @@ private static void runMain(String dir) throws Exception {
2324
Class<?> cls = ucl.loadClass("Test");
2425
Method meth = cls.getMethod("main", String[].class);
2526
Object[] args = new Object[]{ new String[]{ "jvm" } };
27+
28+
System.out.println(MessageStart);
29+
2630
meth.invoke(null, args);
2731
}
2832

compiler/test/dotty/tools/vulpix/ParallelTesting.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
600600
else runMain(testSource.runClassPath) match {
601601
case Success(_) if !checkFile.isDefined || !checkFile.get.exists => // success!
602602
case Success(output) => {
603-
val outputLines = output.lines.filterNot(_.startsWith("Picked up _JAVA_OPTIONS")).toArray :+ DiffUtil.EOF
603+
val outputLines = output.lines.toArray :+ DiffUtil.EOF
604604
val checkLines: Array[String] = Source.fromFile(checkFile.get).getLines().toArray :+ DiffUtil.EOF
605605
val sourceTitle = testSource.title
606606

compiler/test/dotty/tools/vulpix/RunnerOrchestration.scala

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,13 @@ trait RunnerOrchestration {
118118
if (childStdout eq null)
119119
childStdout = new BufferedReader(new InputStreamReader(process.getInputStream))
120120

121-
var childOutput = childStdout.readLine()
121+
var childOutput: String = childStdout.readLine()
122+
123+
// Discard all messages until the test starts
124+
while (childOutput != ChildJVMMain.MessageStart && childOutput != null)
125+
childOutput = childStdout.readLine()
126+
childOutput = childStdout.readLine()
127+
122128
while (childOutput != ChildJVMMain.MessageEnd && childOutput != null) {
123129
sb.append(childOutput)
124130
sb += '\n'

0 commit comments

Comments
 (0)