File tree Expand file tree Collapse file tree 1 file changed +36
-0
lines changed
modules/integration/src/test/scala/scala/cli/integration Expand file tree Collapse file tree 1 file changed +36
-0
lines changed Original file line number Diff line number Diff line change @@ -149,4 +149,40 @@ class RunTestsDefault extends RunTestDefinitions
149
149
}
150
150
}
151
151
}
152
+
153
+ for {
154
+ useTestScope <- Seq (true , false )
155
+ fileName = if (useTestScope) " example.test.scala" else " example.scala"
156
+ scopeOptions = if (useTestScope) Seq (" --test" ) else Seq .empty
157
+ scopeDesc = if (useTestScope) " test" else " main"
158
+ expectedMessage = " Hello, World!"
159
+ platformOptions <- Seq (Seq (" --native" ), Seq (" --js" ), Nil )
160
+ platformDesc = platformOptions.headOption.getOrElse(" JVM" ).stripPrefix(" --" )
161
+ }
162
+ test(
163
+ s " run --cross $platformDesc $actualScalaVersion, ${Constants .scala213} and ${Constants .scala212} ( $scopeDesc scope) "
164
+ ) {
165
+ TestInputs {
166
+ os.rel / fileName ->
167
+ s """ //> using scala $actualScalaVersion ${Constants .scala213} ${Constants .scala212}
168
+ |object Main extends App {
169
+ | println(" $expectedMessage")
170
+ |}
171
+ | """ .stripMargin
172
+ }.fromRoot { root =>
173
+ val r =
174
+ os.proc(
175
+ TestUtil .cli,
176
+ " run" ,
177
+ " ." ,
178
+ " --cross" ,
179
+ " --power" ,
180
+ extraOptions,
181
+ scopeOptions,
182
+ platformOptions
183
+ )
184
+ .call(cwd = root)
185
+ expect(r.out.trim() == expectedMessage)
186
+ }
187
+ }
152
188
}
You can’t perform that action at this time.
0 commit comments