@@ -148,11 +148,12 @@ class CoursierScalaTests:
148
148
149
149
object CoursierScalaTests :
150
150
151
- def execCmd (command : String , options : String * ): ( Int , List [String ]) =
151
+ def execCmd (command : String , options : String * ): List [String ] =
152
152
val cmd = (command :: options.toList).toSeq.mkString(" " )
153
153
val out = new ListBuffer [String ]
154
- val code = cmd.! (ProcessLogger (out += _, out += _))
155
- (code, out.toList)
154
+ val exit = cmd.! (ProcessLogger (out += _, out += _))
155
+ assertEquals(s " running $cmd returned exit code $exit" , 0 , exit)
156
+ out.toList
156
157
157
158
def csScalaCmd (options : String * ): List [String ] =
158
159
csCmd(" dotty.tools.MainGenericRunner" , options* )
@@ -166,16 +167,10 @@ object CoursierScalaTests:
166
167
case Nil => args
167
168
case _ => " --" +: args
168
169
val newJOpts = jOpts.map(s => s " --java-opt ${s.stripPrefix(" -J" )}" ).mkString(" " )
169
- execCmd(" ./cs" , (s """ launch "org.scala-lang:scala3-compiler_3: ${sys.env(" DOTTY_BOOTSTRAPPED_VERSION" )}" $newJOpts --main-class " $entry" --property "scala.usejavacp=true" """ +: newOptions)* )._2
170
+ execCmd(" ./cs" , (s """ launch "org.scala-lang:scala3-compiler_3: ${sys.env(" DOTTY_BOOTSTRAPPED_VERSION" )}" $newJOpts --main-class " $entry" --property "scala.usejavacp=true" """ +: newOptions)* )
170
171
171
172
/** Get coursier script */
172
173
@ BeforeClass def setup (): Unit =
173
- val ver = execCmd(" uname" )._2.head.replace('L' , 'l' ).replace('D' , 'd' )
174
+ val ver = execCmd(" uname" ).head.replace('L' , 'l' ).replace('D' , 'd' )
175
+ Seq (" curl" , s " -fLo cs https://git.io/coursier-cli- $ver" ) #&& execCmd(" chmod" , " +x cs" )
174
176
175
- def runAndCheckCmd (cmd : String , options : String * ): Unit =
176
- val (code, out) = execCmd(cmd, options* )
177
- if code != 0 then
178
- fail(s " Failed to run $cmd ${options.mkString(" " )}, exit code: $code, output: ${out.mkString(" \n " )}" )
179
-
180
- runAndCheckCmd(" curl" , s " -fLo cs https://git.io/coursier-cli- $ver" )
181
- runAndCheckCmd(" chmod" , " +x cs" )
0 commit comments