Skip to content

Commit 1d75a6b

Browse files
Add updateCommand in CommunityBuildTest
1 parent 4da415e commit 1d75a6b

File tree

1 file changed

+46
-32
lines changed

1 file changed

+46
-32
lines changed

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 46 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ class CommunityBuildTest {
2121
* This test reads the compiler version from community-build/dotty-bootstrapped.version
2222
* and expects community-build/sbt-dotty-sbt to set the compiler plugin.
2323
*
24-
* @param project The project name, should be a git submodule in community-build/
25-
* @param command The sbt command used to build the project
24+
* @param project The project name, should be a git submodule in community-build/
25+
* @param command The sbt command used to test the project
26+
* @param updateCommand The sbt command used to update the project
2627
*/
27-
def test(project: String, command: String): Unit = {
28+
def test(project: String, testCommand: String, updateCommand: String): Unit = {
2829
def log(msg: String) = println(Console.GREEN + msg + Console.RESET)
2930

3031
log(s"Building $project with dotty-bootstrapped $compilerVersion...")
@@ -59,7 +60,7 @@ class CommunityBuildTest {
5960
val arguments = Seq(
6061
"-sbt-version", "1.2.7",
6162
s"--addPluginSbtFile=$pluginFilePath",
62-
s";clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++$compilerVersion! $command"
63+
s";clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++$compilerVersion! $testCommand"
6364
)
6465

6566
val exitCode = exec("sbt", arguments: _*)
@@ -82,71 +83,84 @@ class CommunityBuildTest {
8283
}
8384

8485
@Test def algebra = test(
85-
project = "algebra",
86-
command = "coreJVM/compile"
86+
project = "algebra",
87+
testCommand = "coreJVM/compile",
88+
updateCommand = "coreJVM/update"
8789
)
8890

8991
@Test def scalacheck = test(
90-
project = "scalacheck",
91-
command = "jvm/test:compile"
92+
project = "scalacheck",
93+
testCommand = "jvm/test:compile",
94+
updateCommand = "jvm/test:update"
9295
)
9396

9497
@Test def scalatest = test(
95-
project = "scalatest",
96-
command = "scalatest/compile"
98+
project = "scalatest",
99+
testCommand = "scalatest/compile",
100+
updateCommand = "scalatest/update"
97101
)
98102

99103
@Test def scopt = test(
100-
project = "scopt",
101-
command = "scoptJVM/compile"
104+
project = "scopt",
105+
testCommand = "scoptJVM/compile",
106+
updateCommand = "scoptJVM/update"
102107
)
103108

104109
@Test def scalap = test(
105-
project = "scalap",
106-
command = "scalap/compile"
110+
project = "scalap",
111+
testCommand = "scalap/compile",
112+
updateCommand = "scalap/update"
107113
)
108114

109115
@Test def squants = test(
110-
project = "squants",
111-
command = "squantsJVM/compile"
116+
project = "squants",
117+
testCommand = "squantsJVM/compile",
118+
updateCommand = "squantsJVM/update"
112119
)
113120

114121
@Test def betterfiles = test(
115-
project = "betterfiles",
116-
command = "dotty-community-build/compile"
122+
project = "betterfiles",
123+
testCommand = "dotty-community-build/compile",
124+
updateCommand = "dotty-community-build/update"
117125
)
118126

119127
@Test def ScalaPB = test(
120-
project = "ScalaPB",
121-
command = "dotty-community-build/compile"
128+
project = "ScalaPB",
129+
testCommand = "dotty-community-build/compile",
130+
updateCommand = "dotty-community-build/update"
122131
)
123132

124133
@Test def minitest = test(
125-
project = "minitest",
126-
command = "dotty-community-build/compile"
134+
project = "minitest",
135+
testCommand = "dotty-community-build/compile",
136+
updateCommand = "dotty-community-build/update"
127137
)
128138

129139
@Test def fastparse = test(
130-
project = "fastparse",
131-
command = "fastparseJVM/compile"
140+
project = "fastparse",
141+
testCommand = "fastparseJVM/compile",
142+
updateCommand = "fastparseJVM/update"
132143
)
133144

134145
// TODO: revert to sourcecodeJVM/test
135146
@Test def sourcecode = test(
136-
project = "sourcecode",
137-
command = "sourcecodeJVM/compile"
147+
project = "sourcecode",
148+
testCommand = "sourcecodeJVM/compile",
149+
updateCommand = "sourcecodeJVM/update"
138150
)
139151

140152
// TODO @smarter?
141153
// @Test def stdLib213 = test(
142-
// project = "stdLib213",
143-
// command = "library/compile"
154+
// project = "stdLib213",
155+
// testCommand = "library/compile",
156+
// updateCommand = "library/update"
144157
// )
145158

146159
// TODO @oderky? It got broken by #5458
147160
// @Test def pdbp = test(
148-
// project = "pdbp",
149-
// command = "compile"
161+
// project = "pdbp",
162+
// testCommand = "compile",
163+
// updateCommand = "update"
150164
// )
151165
}
152166

@@ -155,6 +169,6 @@ class UpdateCategory
155169

156170
@Category(Array(classOf[UpdateCategory]))
157171
class CommunityBuildUpdate extends CommunityBuildTest {
158-
override def test(project: String, command: String): Unit =
159-
super.test(project, command.split("/").head + "/update")
172+
override def test(project: String, testCommand: String, updateCommand: String): Unit =
173+
super.test(project, updateCommand, null)
160174
}

0 commit comments

Comments
 (0)