@@ -5,7 +5,9 @@ import java.io.{PrintWriter, File}
5
5
import java .nio .charset .StandardCharsets .UTF_8
6
6
import org .junit .{Ignore , Test }
7
7
import org .junit .Assert .{assertEquals , fail }
8
+ import org .junit .experimental .categories .Category
8
9
10
+ @ Category (Array (classOf [TestCategory ]))
9
11
class CommunityBuildTest {
10
12
lazy val communitybuildDir : Path = Paths .get(sys.props(" user.dir" ) + " /community-build/" )
11
13
@@ -19,10 +21,11 @@ class CommunityBuildTest {
19
21
* This test reads the compiler version from community-build/dotty-bootstrapped.version
20
22
* and expects community-build/sbt-dotty-sbt to set the compiler plugin.
21
23
*
22
- * @param project The project name, should be a git submodule in community-build/
23
- * @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
24
27
*/
25
- def test (project : String , command : String ): Unit = {
28
+ def test (project : String , testCommand : String , updateCommand : String ): Unit = {
26
29
def log (msg : String ) = println(Console .GREEN + msg + Console .RESET )
27
30
28
31
log(s " Building $project with dotty-bootstrapped $compilerVersion... " )
@@ -57,7 +60,7 @@ class CommunityBuildTest {
57
60
val arguments = Seq (
58
61
" -sbt-version" , " 1.2.7" ,
59
62
s " --addPluginSbtFile= $pluginFilePath" ,
60
- s " ;clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++ $compilerVersion! $command "
63
+ s " ;clean ;set updateOptions in Global ~= (_.withLatestSnapshots(false)) ;++ $compilerVersion! $testCommand "
61
64
)
62
65
63
66
val exitCode = exec(" sbt" , arguments : _* )
@@ -80,69 +83,91 @@ class CommunityBuildTest {
80
83
}
81
84
82
85
@ Test def algebra = test(
83
- project = " algebra" ,
84
- command = " coreJVM/compile"
86
+ project = " algebra" ,
87
+ testCommand = " coreJVM/compile" ,
88
+ updateCommand = " coreJVM/update"
85
89
)
86
90
87
91
@ Test def scalacheck = test(
88
- project = " scalacheck" ,
89
- command = " jvm/test:compile"
92
+ project = " scalacheck" ,
93
+ testCommand = " jvm/test:compile" ,
94
+ updateCommand = " jvm/test:update"
90
95
)
91
96
92
97
@ Test def scalatest = test(
93
- project = " scalatest" ,
94
- command = " scalatest/compile"
98
+ project = " scalatest" ,
99
+ testCommand = " scalatest/compile" ,
100
+ updateCommand = " scalatest/update"
95
101
)
96
102
97
103
@ Test def scopt = test(
98
- project = " scopt" ,
99
- command = " scoptJVM/compile"
104
+ project = " scopt" ,
105
+ testCommand = " scoptJVM/compile" ,
106
+ updateCommand = " scoptJVM/update"
100
107
)
101
108
102
109
@ Test def scalap = test(
103
- project = " scalap" ,
104
- command = " scalap/compile"
110
+ project = " scalap" ,
111
+ testCommand = " scalap/compile" ,
112
+ updateCommand = " scalap/update"
105
113
)
106
114
107
115
@ Test def squants = test(
108
- project = " squants" ,
109
- command = " squantsJVM/compile"
116
+ project = " squants" ,
117
+ testCommand = " squantsJVM/compile" ,
118
+ updateCommand = " squantsJVM/update"
110
119
)
111
120
112
121
@ Test def betterfiles = test(
113
- project = " betterfiles" ,
114
- command = " dotty-community-build/compile"
122
+ project = " betterfiles" ,
123
+ testCommand = " dotty-community-build/compile" ,
124
+ updateCommand = " dotty-community-build/update"
115
125
)
116
126
117
127
@ Test def ScalaPB = test(
118
- project = " ScalaPB" ,
119
- command = " dotty-community-build/compile"
128
+ project = " ScalaPB" ,
129
+ testCommand = " dotty-community-build/compile" ,
130
+ updateCommand = " dotty-community-build/update"
120
131
)
121
132
122
133
@ Test def minitest = test(
123
- project = " minitest" ,
124
- command = " dotty-community-build/compile"
134
+ project = " minitest" ,
135
+ testCommand = " dotty-community-build/compile" ,
136
+ updateCommand = " dotty-community-build/update"
125
137
)
126
138
127
139
@ Test def fastparse = test(
128
- project = " fastparse" ,
129
- command = " fastparseJVM/compile"
140
+ project = " fastparse" ,
141
+ testCommand = " fastparseJVM/compile" ,
142
+ updateCommand = " fastparseJVM/update"
130
143
)
131
144
132
145
// TODO: revert to sourcecodeJVM/test
133
146
@ Test def sourcecode = test(
134
- project = " sourcecode" ,
135
- command = " sourcecodeJVM/compile"
147
+ project = " sourcecode" ,
148
+ testCommand = " sourcecodeJVM/compile" ,
149
+ updateCommand = " sourcecodeJVM/update"
136
150
)
137
151
138
152
@ Test def stdLib213 = test(
139
- project = " stdLib213" ,
140
- command = " library/compile"
153
+ project = " stdLib213" ,
154
+ testCommand = " library/compile" ,
155
+ updateCommand = " library/update"
141
156
)
142
157
143
158
// TODO @oderky? It got broken by #5458
144
159
// @Test def pdbp = test(
145
- // project = "pdbp",
146
- // command = "compile"
160
+ // project = "pdbp",
161
+ // testCommand = "compile",
162
+ // updateCommand = "update"
147
163
// )
148
164
}
165
+
166
+ class TestCategory
167
+ class UpdateCategory
168
+
169
+ @ Category (Array (classOf [UpdateCategory ]))
170
+ class CommunityBuildUpdate extends CommunityBuildTest {
171
+ override def test (project : String , testCommand : String , updateCommand : String ): Unit =
172
+ super .test(project, updateCommand, null )
173
+ }
0 commit comments