Skip to content

Commit 9354f4e

Browse files
committed
Hide progress bar when user is debugging the tests
1 parent 708607d commit 9354f4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import scala.language.unsafeNulls
66

77
import java.io.{File => JFile, IOException, PrintStream, ByteArrayOutputStream}
88
import java.lang.System.{lineSeparator => EOL}
9+
import java.lang.management.ManagementFactory
910
import java.net.URL
1011
import java.nio.file.StandardCopyOption.REPLACE_EXISTING
1112
import java.nio.file.{Files, NoSuchFileException, Path, Paths}
@@ -459,7 +460,7 @@ trait ParallelTesting extends RunnerOrchestration { self =>
459460

460461
/** Print a progress bar for the current `Test` */
461462
private def updateProgressMonitor(start: Long): Unit =
462-
if testSourcesCompleted < sourceCount then
463+
if testSourcesCompleted < sourceCount && !isUserDebugging then
463464
realStdout.print(s"\r${makeProgressBar(start)}")
464465

465466
private def finishProgressMonitor(start: Long): Unit =
@@ -1832,6 +1833,11 @@ trait ParallelTesting extends RunnerOrchestration { self =>
18321833
flags.options.sliding(2).collectFirst {
18331834
case Array("-encoding", encoding) => Charset.forName(encoding)
18341835
}.getOrElse(StandardCharsets.UTF_8)
1836+
1837+
/** checks if the current process is being debugged */
1838+
def isUserDebugging: Boolean =
1839+
val mxBean = ManagementFactory.getRuntimeMXBean
1840+
mxBean.getInputArguments.asScala.exists(_.contains("jdwp"))
18351841
}
18361842

18371843
object ParallelTesting {

0 commit comments

Comments
 (0)