Skip to content

Commit c549437

Browse files
dwijnandadriaanm
authored andcommitted
Simplify & cleanup some test task definitions (scala#6798)
Simplify test task definitions If you're not interested in the task results, don't ask for them. That way you don't have to work around discarding them too! Remove testRest, which had been added when we were running into time limits, but we no longer are.
1 parent 80ee48b commit c549437

File tree

1 file changed

+15
-25
lines changed

1 file changed

+15
-25
lines changed

build.sbt

Lines changed: 15 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -770,6 +770,12 @@ lazy val scalaDist = Project("scala-dist", file(".") / "target" / "scala-dist-di
770770
)
771771
.dependsOn(library, reflect, compiler, scalap)
772772

773+
def partestOnly(in: String): Def.Initialize[Task[Unit]] =
774+
(testOnly in IntegrationTest in testP).toTask(" -- " + in)
775+
776+
def partestDesc(in: String): Def.Initialize[Task[(Result[Unit], String)]] =
777+
partestOnly(in).result map (_ -> s"partest $in")
778+
773779
lazy val root: Project = (project in file("."))
774780
.settings(disableDocs)
775781
.settings(disablePublishing)
@@ -799,35 +805,20 @@ lazy val root: Project = (project in file("."))
799805
state
800806
},
801807

802-
testRun := { val v = (testOnly in IntegrationTest in testP).toTask(" -- run").result.value },
803-
804-
testPosPres := { val v = (testOnly in IntegrationTest in testP).toTask(" -- pos presentation").result.value },
805-
806-
testRest := {
807-
val v = ScriptCommands.sequence[Result[Unit]](List(
808-
(mimaReportBinaryIssues in library).result,
809-
(mimaReportBinaryIssues in reflect).result,
810-
(Keys.test in Test in junit).result,
811-
(Keys.test in Test in scalacheck).result,
812-
(testOnly in IntegrationTest in testP).toTask(" -- neg jvm").result,
813-
(testOnly in IntegrationTest in testP).toTask(" -- res scalap specialized").result,
814-
(testOnly in IntegrationTest in testP).toTask(" -- instrumented").result,
815-
(testOnly in IntegrationTest in testP).toTask(" -- --srcpath scaladoc").result,
816-
(Keys.test in Test in osgiTestFelix).result,
817-
(Keys.test in Test in osgiTestEclipse).result)).value
818-
},
808+
testRun := partestOnly("run").value,
809+
testPosPres := partestOnly("pos presentation").value,
819810

820-
// all of testRun, testPosPres, testRest and more
811+
// all of testRun, testPosPres and more
821812
testAll := {
822813
val results = ScriptCommands.sequence[(Result[Unit], String)](List(
823814
(Keys.test in Test in junit).result map (_ -> "junit/test"),
824815
(Keys.test in Test in scalacheck).result map (_ -> "scalacheck/test"),
825-
(testOnly in IntegrationTest in testP).toTask(" -- run").result map (_ -> "partest run"),
826-
(testOnly in IntegrationTest in testP).toTask(" -- pos neg jvm").result map (_ -> "partest pos neg jvm"),
827-
(testOnly in IntegrationTest in testP).toTask(" -- res scalap specialized").result map (_ -> "partest res scalap specialized"),
828-
(testOnly in IntegrationTest in testP).toTask(" -- instrumented presentation").result map (_ -> "partest instrumented presentation"),
829-
(testOnly in IntegrationTest in testP).toTask(" -- --srcpath scaladoc").result map (_ -> "partest --srcpath scaladoc"),
830-
(testOnly in IntegrationTest in testP).toTask(" -- -Dpartest.scalac_opts=-Ymacro-annotations --srcpath macro-annot").result map (_ -> "partest --srcpath macro-annot"),
816+
partestDesc("run"),
817+
partestDesc("pos neg jvm"),
818+
partestDesc("res scalap specialized"),
819+
partestDesc("instrumented presentation"),
820+
partestDesc("--srcpath scaladoc"),
821+
partestDesc("-Dpartest.scalac_opts=-Ymacro-annotations --srcpath macro-annot"),
831822
(Keys.test in Test in osgiTestFelix).result map (_ -> "osgiTestFelix/test"),
832823
(Keys.test in Test in osgiTestEclipse).result map (_ -> "osgiTestEclipse/test"),
833824
(mimaReportBinaryIssues in library).result map (_ -> "library/mimaReportBinaryIssues"),
@@ -954,7 +945,6 @@ lazy val testAll = taskKey[Unit]("Run all test tasks sequentially")
954945

955946
lazy val testRun = taskKey[Unit]("Run compute intensive test tasks sequentially")
956947
lazy val testPosPres = taskKey[Unit]("Run compilation test (pos + presentation) sequentially")
957-
lazy val testRest = taskKey[Unit]("Run the remaining test tasks sequentially")
958948

959949
// Defining these settings is somewhat redundant as we also redefine settings that depend on them.
960950
// However, IntelliJ's project import works better when these are set correctly.

0 commit comments

Comments
 (0)