From 6700dbd6b4e6d809891840201df16b7fd2eaf625 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Wed, 23 Nov 2016 16:56:07 +0100 Subject: Make sure limitedThreads <= partest.threads --- compiler/test/dotty/partest/DPConsoleRunner.scala | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'compiler/test/dotty/partest/DPConsoleRunner.scala') diff --git a/compiler/test/dotty/partest/DPConsoleRunner.scala b/compiler/test/dotty/partest/DPConsoleRunner.scala index 1e0be75d8..f418d2c37 100644 --- a/compiler/test/dotty/partest/DPConsoleRunner.scala +++ b/compiler/test/dotty/partest/DPConsoleRunner.scala @@ -114,9 +114,16 @@ extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPat val seqResults = if (!limitResourceTests.isEmpty) { val savedThreads = sys.props("partest.threads") - sys.props("partest.threads") = limitedThreads + sys.props("partest.threads") = { + assert( + savedThreads == null || limitedThreads.toInt <= savedThreads.toInt, + """|Should not use more threads than the default, when the point + |is to limit the amount of resources""".stripMargin + ) + limitedThreads + } - NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s)") + NestUI.echo(s"## we will run ${limitResourceTests.length} tests using ${PartestDefaults.numThreads} thread(s) in parallel") val res = super.runTestsForFiles(limitResourceTests, kind) if (savedThreads != null) @@ -392,13 +399,9 @@ class DPTestRunner(testFile: File, suiteRunner: DPSuiteRunner) extends nest.Runn suiteRunner.fileManager.asInstanceOf[DottyFileManager].extraJarList ::: super.extraClasspath // override to keep class files if failed and delete clog if ok - override def cleanup = if (lastState.isOk) try { + override def cleanup = if (lastState.isOk) { logFile.delete cLogFile.delete Directory(outDir).deleteRecursively - } catch { - case t: Throwable => - println("whhhhhhhhhhhhhhhhhhhhhhhhhhhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaat") - throw t } } -- cgit v1.2.3