mirror of https://github.com/sbt/sbt.git
Add tests for supporting -debug flag in SBT_OPTSs
This commit is contained in:
parent
b7558e11b9
commit
4872ddf3ef
|
|
@ -137,6 +137,20 @@ object SbtRunnerTest extends SimpleTestSuite with PowerAssertions {
|
|||
()
|
||||
}
|
||||
|
||||
test("sbt with -debug in SBT_OPTS appears in sbt commands") {
|
||||
val out: List[String] = sbtProcessWithOpts("compile", "-v")("", "-debug").!!.linesIterator.toList
|
||||
// Debug argument must appear in the 'commands' section after sbt-launch.jar to work
|
||||
val locationOfSbtLaunchJarArg = out.zipWithIndex.collectFirst {
|
||||
case (arg, index) if arg.endsWith("sbt-launch.jar") => index
|
||||
}
|
||||
|
||||
assert(locationOfSbtLaunchJarArg.nonEmpty)
|
||||
|
||||
val argsAfterSbtLaunch = out.drop(locationOfSbtLaunchJarArg.get)
|
||||
assert(argsAfterSbtLaunch.contains("-debug"))
|
||||
()
|
||||
}
|
||||
|
||||
test("sbt -V|-version|--version should print sbtVersion") {
|
||||
val out = sbtProcess("-version").!!.trim
|
||||
val expectedVersion =
|
||||
|
|
|
|||
|
|
@ -353,11 +353,11 @@ run() {
|
|||
java_args=($JAVA_OPTS)
|
||||
sbt_options0=(${SBT_OPTS:-$default_sbt_opts})
|
||||
|
||||
# Split SBT_OPTs into options/commands
|
||||
# Split SBT_OPTS into options/commands
|
||||
miniscript=$(map_args "${sbt_options0[@]}") && eval "${miniscript/options/sbt_options}" && \
|
||||
eval "${miniscript/commands/sbt_additional_commands}"
|
||||
|
||||
# Combine command line options/commands and commands from SBT_OPTs
|
||||
# Combine command line options/commands and commands from SBT_OPTS
|
||||
miniscript=$(map_args "$@") && eval "${miniscript/options/cli_options}" && eval "${miniscript/commands/cli_commands}"
|
||||
args1=( "${cli_options[@]}" "${cli_commands[@]}" "${sbt_additional_commands[@]}" )
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue