summaryrefslogtreecommitdiff
path: root/src/partest
diff options
context:
space:
mode:
authorGilles Dubochet <gilles.dubochet@epfl.ch>2010-03-23 14:38:11 +0000
committerGilles Dubochet <gilles.dubochet@epfl.ch>2010-03-23 14:38:11 +0000
commitef1577a9c5a9f2905e9b89b1508f97127d941bd7 (patch)
tree009b8393710f33c0c4f8d6560a36d270a3c0cab7 /src/partest
parentfb8c14ea43d273466b7d01bb00ce4185d9a91091 (diff)
downloadscala-ef1577a9c5a9f2905e9b89b1508f97127d941bd7.tar.gz
scala-ef1577a9c5a9f2905e9b89b1508f97127d941bd7.tar.bz2
scala-ef1577a9c5a9f2905e9b89b1508f97127d941bd7.zip
Scala signature is generated as an annotation (...
Scala signature is generated as an annotation (that is accessible through Java reflection). - compiler generates all pickled Scala signatures as annotations to class files. - compiler can read class files with signature as annotations or old-style signatures as attributes. - Scalap has also been updated to new signatures (contributed by Ilya Sergey: thanks a lot). - FJBG updated to allow entering constant pool strings as byte arrays. - ByteCodecs decode method returns the length of the decoded array. Review by ilyas. Already mostly reviewed by odersky.
Diffstat (limited to 'src/partest')
-rw-r--r--src/partest/scala/tools/partest/nest/ConsoleRunner.scala2
-rw-r--r--src/partest/scala/tools/partest/nest/Worker.scala11
2 files changed, 3 insertions, 10 deletions
diff --git a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
index f7eca614ac..eae79f23af 100644
--- a/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
+++ b/src/partest/scala/tools/partest/nest/ConsoleRunner.scala
@@ -36,7 +36,7 @@ class ConsoleRunner extends DirectRunner {
TestSet("shootout", pathFilter, "Testing shootout tests"),
TestSet("script", pathFilter, "Testing script tests"),
TestSet("scalacheck", pathFilter, "Testing ScalaCheck tests"),
- TestSet("scalap", pathFilter, "Run scalap decompiler tests")
+ TestSet("scalap", _.isDirectory, "Run scalap decompiler tests")
)
}
diff --git a/src/partest/scala/tools/partest/nest/Worker.scala b/src/partest/scala/tools/partest/nest/Worker.scala
index 213123f711..cf4a8238e9 100644
--- a/src/partest/scala/tools/partest/nest/Worker.scala
+++ b/src/partest/scala/tools/partest/nest/Worker.scala
@@ -820,14 +820,6 @@ class Worker(val fileManager: FileManager) extends Actor {
case "scalap" => {
- def decompileFile(clazz: Class[_], packObj: Boolean) = {
- val byteCode = ByteCode.forClass(clazz)
- val classFile = ClassFileParser.parse(byteCode)
- val Some(sig) = classFile.attribute("ScalaSig").map(_.byteCode).map(ScalaSigAttributeParsers.parse)
- import scala.tools.scalap.Main._
- parseScalaSignature(sig, packObj)
- }
-
runInContext(file, kind, (logFile: File, outDir: File) => {
val sourceDir = file.getParentFile
val sourceDirName = sourceDir.getName
@@ -854,7 +846,8 @@ class Worker(val fileManager: FileManager) extends Actor {
val loader = new URLClassLoader(Array(url), getClass.getClassLoader)
val clazz = loader.loadClass(className)
- val result = decompileFile(clazz, isPackageObject)
+ val byteCode = ByteCode.forClass(clazz)
+ val result = scala.tools.scalap.Main.decompileScala(byteCode.bytes, isPackageObject)
try {
val fstream = new FileWriter(logFile);