summaryrefslogtreecommitdiff
path: root/src/partest/scala/tools/partest/ReplTest.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-05-05 23:46:31 +0000
committerPaul Phillips <paulp@improving.org>2011-05-05 23:46:31 +0000
commita0ea242f75c83717bc8019d1be7865a52fd6186f (patch)
tree26c7a021f34ab6f2e719ac63266d2be90fce3875 /src/partest/scala/tools/partest/ReplTest.scala
parentd70e69e8a8a736e2a7f55e2abf651507b0c542a7 (diff)
downloadscala-a0ea242f75c83717bc8019d1be7865a52fd6186f.tar.gz
scala-a0ea242f75c83717bc8019d1be7865a52fd6186f.tar.bz2
scala-a0ea242f75c83717bc8019d1be7865a52fd6186f.zip
Be silent when compiling the repl extraction ob...
Be silent when compiling the repl extraction object to suppress spurious warnings. Also corrected the busted logic for spotting repl wrappers. Closes #4542, no review.
Diffstat (limited to 'src/partest/scala/tools/partest/ReplTest.scala')
-rw-r--r--src/partest/scala/tools/partest/ReplTest.scala47
1 files changed, 7 insertions, 40 deletions
diff --git a/src/partest/scala/tools/partest/ReplTest.scala b/src/partest/scala/tools/partest/ReplTest.scala
index b31c43ba6f..dd21e7906a 100644
--- a/src/partest/scala/tools/partest/ReplTest.scala
+++ b/src/partest/scala/tools/partest/ReplTest.scala
@@ -14,48 +14,15 @@ import java.lang.reflect.{ Method => JMethod, Field => JField }
*/
abstract class ReplTest extends App {
def code: String
- def settings: Settings = new Settings // override for custom settings
+ // override to add additional settings
+ def extraSettings: String = ""
+ def settings: Settings = {
+ val s = new Settings
+ s processArgumentString extraSettings
+ s
+ }
def eval() = ILoop.runForTranscript(code, settings).lines drop 1
def show() = eval() foreach println
show()
}
-
-trait SigTest {
- def mstr(m: JMethod) = " (m) %s%s".format(
- m.toGenericString,
- if (m.isBridge) " (bridge)" else ""
- )
- def fstr(f: JField) = " (f) %s".format(f.toGenericString)
-
- def isObjectMethodName(name: String) = classOf[Object].getMethods exists (_.getName == name)
-
- def fields[T: ClassManifest](p: JField => Boolean) = {
- val cl = classManifest[T].erasure
- val fs = (cl.getFields ++ cl.getDeclaredFields).distinct sortBy (_.getName)
-
- fs filter p
- }
- def methods[T: ClassManifest](p: JMethod => Boolean) = {
- val cl = classManifest[T].erasure
- val ms = (cl.getMethods ++ cl.getDeclaredMethods).distinct sortBy (x => (x.getName, x.isBridge))
-
- ms filter p
- }
- def allFields[T: ClassManifest]() = fields[T](_ => true)
- def allMethods[T: ClassManifest]() = methods[T](m => !isObjectMethodName(m.getName))
- def fieldsNamed[T: ClassManifest](name: String) = fields[T](_.getName == name)
- def methodsNamed[T: ClassManifest](name: String) = methods[T](_.getName == name)
-
- def allGenericStrings[T: ClassManifest]() =
- (allMethods[T]() map mstr) ++ (allFields[T]() map fstr)
-
- def genericStrings[T: ClassManifest](name: String) =
- (methodsNamed[T](name) map mstr) ++ (fieldsNamed[T](name) map fstr)
-
- def show[T: ClassManifest](name: String = "") = {
- println(classManifest[T].erasure.getName)
- if (name == "") allGenericStrings[T]() foreach println
- else genericStrings[T](name) foreach println
- }
-}