summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ochsenreither <simon@ochsenreither.de>2013-07-30 18:49:41 +0200
committerSimon Ochsenreither <simon@ochsenreither.de>2013-07-30 18:49:41 +0200
commitaa5099e3f61bed00cc340b1c4dc84d9031ed5e00 (patch)
tree6f3106743dbff3d95962477969ff1a6ab6ba66cf
parent59e21f37cb80215ada0db60363fb9f30adf6a0cd (diff)
downloadscala-aa5099e3f61bed00cc340b1c4dc84d9031ed5e00.tar.gz
scala-aa5099e3f61bed00cc340b1c4dc84d9031ed5e00.tar.bz2
scala-aa5099e3f61bed00cc340b1c4dc84d9031ed5e00.zip
SI-7704 Fix partest's test category selection
My recent changes to command line parsing in 6090709 broke partest's functionality of picking test categories (e. g. --pos or --run). The breakage was caused because scala.tools.cmd._ stored the command line options with the `--` prefix, but TestKinds.standardKinds did not.
-rw-r--r--src/compiler/scala/tools/cmd/CommandLine.scala4
-rw-r--r--src/compiler/scala/tools/cmd/Opt.scala2
-rw-r--r--src/compiler/scala/tools/cmd/Reference.scala6
3 files changed, 6 insertions, 6 deletions
diff --git a/src/compiler/scala/tools/cmd/CommandLine.scala b/src/compiler/scala/tools/cmd/CommandLine.scala
index e44752eb6e..8d76807d7d 100644
--- a/src/compiler/scala/tools/cmd/CommandLine.scala
+++ b/src/compiler/scala/tools/cmd/CommandLine.scala
@@ -24,7 +24,7 @@ class CommandLine(val spec: Reference, val originalArgs: List[String]) extends C
val Terminator = "--"
val ValueForUnaryOption = "true" // so if --opt is given, x(--opt) = true
- def mapForUnary(opt: String) = Map(opt -> ValueForUnaryOption)
+ def mapForUnary(opt: String) = Map(fromOpt(opt) -> ValueForUnaryOption)
def errorFn(msg: String) = println(msg)
/** argMap is option -> argument (or "" if it is a unary argument)
@@ -72,7 +72,7 @@ class CommandLine(val spec: Reference, val originalArgs: List[String]) extends C
if (x2 == Terminator) mapForUnary(x1) ++ residual(xs)
else if (isUnaryOption(x1)) mapForUnary(x1) ++ loop(args.tail)
- else if (isBinaryOption(x1)) Map(x1 -> x2) ++ loop(xs)
+ else if (isBinaryOption(x1)) Map(fromOpt(x1) -> x2) ++ loop(xs)
else if (isUnknown(x1)) loop(args.tail)
else residual(List(x1)) ++ loop(args.tail)
}
diff --git a/src/compiler/scala/tools/cmd/Opt.scala b/src/compiler/scala/tools/cmd/Opt.scala
index 2c193128f1..5aee33ec4a 100644
--- a/src/compiler/scala/tools/cmd/Opt.scala
+++ b/src/compiler/scala/tools/cmd/Opt.scala
@@ -26,7 +26,7 @@ object Opt {
trait Implicit {
def name: String
def programInfo: Info
- protected def opt = toOpt(name)
+ protected def opt = fromOpt(name)
def --? : Boolean // --opt is set
def --> (body: => Unit): Unit // if --opt is set, execute body
diff --git a/src/compiler/scala/tools/cmd/Reference.scala b/src/compiler/scala/tools/cmd/Reference.scala
index ec2a414065..9e91b55f44 100644
--- a/src/compiler/scala/tools/cmd/Reference.scala
+++ b/src/compiler/scala/tools/cmd/Reference.scala
@@ -23,9 +23,9 @@ trait Reference extends Spec {
def helpMsg = options.helpMsg
def propertyArgs: List[String] = Nil
- def isUnaryOption(s: String) = unary contains toOpt(s)
- def isBinaryOption(s: String) = binary contains toOpt(s)
- def isExpandOption(s: String) = expansionMap contains toOpt(s)
+ def isUnaryOption(s: String) = unary contains fromOpt(s)
+ def isBinaryOption(s: String) = binary contains fromOpt(s)
+ def isExpandOption(s: String) = expansionMap contains fromOpt(s)
def expandArg(arg: String) = expansionMap.getOrElse(fromOpt(arg), List(arg))