diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-11-23 16:56:07 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-11-23 18:08:54 +0100 |
commit | 6700dbd6b4e6d809891840201df16b7fd2eaf625 (patch) | |
tree | 98baef723f141251c1e1f8a0146bec85d59d85f5 | |
parent | c429733272d9f8725e7769f63ebd9a86a403cd09 (diff) | |
download | dotty-6700dbd6b4e6d809891840201df16b7fd2eaf625.tar.gz dotty-6700dbd6b4e6d809891840201df16b7fd2eaf625.tar.bz2 dotty-6700dbd6b4e6d809891840201df16b7fd2eaf625.zip |
Make sure limitedThreads <= partest.threads
-rw-r--r-- | compiler/test/dotty/partest/DPConsoleRunner.scala | 17 |
1 files changed, 10 insertions, 7 deletions
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 } } |