diff --git a/.larabot.conf b/.larabot.conf index 6a037e0addc616364cb0b049075beb1f7c2d18c7..22677f335772a86a268d5f6f7aa48ad813c8b0b5 100644 --- a/.larabot.conf +++ b/.larabot.conf @@ -1,8 +1,8 @@ commands = [ - "sbt -batch test" - "sbt -batch integration:test" - "sbt -batch regression:test" - "sbt -batch genc:test" + "sbt -batch -Dparallel=10 test" + "sbt -batch -Dparallel=10 integration:test" + "sbt -batch -Dparallel=10 regression:test" + "sbt -batch -Dparallel=10 genc:test" ] trusted = [ diff --git a/build.sbt b/build.sbt index 0e3e147a10e395fb58a0ebb3f981b9919deb56b9..6507f84a78b8bb3528d58121fe16e40b88f9ce09 100644 --- a/build.sbt +++ b/build.sbt @@ -56,6 +56,20 @@ clean := { } } +lazy val nParallel = { + val p = System.getProperty("parallel") + if (p ne null) { + try { + p.toInt + } catch { + case nfe: NumberFormatException => + 1 + } + } else { + 1 + } +} + lazy val script = taskKey[Unit]("Generate the leon Bash script") script := { @@ -107,14 +121,17 @@ sourcesInBase in Compile := false Keys.fork in run := true + lazy val testSettings = Seq( //Keys.fork := true, - logBuffered := true, - parallelExecution := true + logBuffered := (nParallel > 1), + parallelExecution := (nParallel > 1) //testForkedParallel := true, //javaOptions ++= Seq("-Xss64M", "-Xmx4G") ) +concurrentRestrictions in Global += Tags.limit(Tags.Test, nParallel) + // Unit Tests testOptions in Test := Seq(Tests.Argument("-oDF"), Tests.Filter(_ startsWith "leon.unit.")) @@ -138,7 +155,6 @@ lazy val IsabelleTest = config("isabelle") extend(Test) testOptions in IsabelleTest := Seq(Tests.Argument("-oDF"), Tests.Filter(_ startsWith "leon.isabelle.")) parallelExecution in IsabelleTest := false - fork in IsabelleTest := true // GenC Tests