Skip to content

Commit

Permalink
Run tests in parallel when asked only (-Dparallel=123)
Browse files Browse the repository at this point in the history
  • Loading branch information
colder committed Feb 12, 2016
1 parent eee70ef commit f75c629
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
8 changes: 4 additions & 4 deletions .larabot.conf
Original file line number Diff line number Diff line change
@@ -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 = [
Expand Down
22 changes: 19 additions & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -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 := {
Expand Down Expand Up @@ -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."))

Expand All @@ -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
Expand Down

0 comments on commit f75c629

Please sign in to comment.