Skip to content

Commit d57fd8b

Browse files
committed
partest: run tests with -Xms64M -Xmx1024M instead of JVM defaults
This is the same settings that scalac uses, this should help use avoid using too much memory (the default on 64 bits Linux seems to be -Xms248M -Xmx3938M).
1 parent 13b6165 commit d57fd8b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

test/dotty/partest/DPConfig.scala

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import scala.collection.JavaConversions._
44
import scala.reflect.io.Path
55
import java.io.File
66

7+
import scala.tools.partest.PartestDefaults
8+
79

810
/** Dotty Partest runs all tests in the provided testDirs located under
911
* testRoot. There can be several directories with pos resp. neg tests, as
@@ -15,6 +17,12 @@ import java.io.File
1517
* otherwise pos/__defaultFlags.flags are used if the file exists).
1618
*/
1719
object DPConfig {
20+
/** Options used for _running_ the run tests.
21+
* Note that this is different from the options used when _compiling_ tests,
22+
* those are determined by the sbt configuration.
23+
*/
24+
val runJVMOpts = s"-Xms64M -Xmx1024M ${PartestDefaults.javaOpts}"
25+
1826
val testRoot = (Path(".") / Path("tests") / Path("partest-generated")).toString
1927
val genLog = Path(testRoot) / Path("gen.log")
2028

test/dotty/partest/DPConsoleRunner.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,9 @@ class DPSuiteRunner(testSourcePath: String, // relative path, like "files", or "
6565
consoleArgs: String,
6666
javaCmdPath: String = PartestDefaults.javaCmd,
6767
javacCmdPath: String = PartestDefaults.javacCmd,
68-
scalacExtraArgs: Seq[String] = Seq.empty)
69-
extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPath, javacCmdPath, scalacExtraArgs) {
68+
scalacExtraArgs: Seq[String] = Seq.empty,
69+
javaOpts: String = DPConfig.runJVMOpts)
70+
extends SuiteRunner(testSourcePath, fileManager, updateCheck, failed, javaCmdPath, javacCmdPath, scalacExtraArgs, javaOpts) {
7071

7172
if (!DPConfig.runTestsInParallel)
7273
sys.props("partest.threads") = "1"

0 commit comments

Comments
 (0)