aboutsummaryrefslogtreecommitdiff
path: root/test/test/CompilerTest.scala
diff options
context:
space:
mode:
authorMartin Odersky <odersky@gmail.com>2014-03-09 19:06:01 +0100
committerMartin Odersky <odersky@gmail.com>2014-03-10 11:03:44 +0100
commite1ec7ede675143492510b2d90260a430125e0808 (patch)
tree0a8a5ba3fa12369c3783f6f637ae94502a31bd5b /test/test/CompilerTest.scala
parentd827b0180b05e7461856f668c3c4ca0ea6ed5d62 (diff)
downloaddotty-e1ec7ede675143492510b2d90260a430125e0808.tar.gz
dotty-e1ec7ede675143492510b2d90260a430125e0808.tar.bz2
dotty-e1ec7ede675143492510b2d90260a430125e0808.zip
Improve test infrastructure
1) New method compileFiles which allows one to compile the content of a directory one file or directory after another. 2) max constraint is printed to typr. Added new test pos_all. Other pos tests can be retired.
Diffstat (limited to 'test/test/CompilerTest.scala')
-rw-r--r--test/test/CompilerTest.scala18
1 files changed, 16 insertions, 2 deletions
diff --git a/test/test/CompilerTest.scala b/test/test/CompilerTest.scala
index 26a0b3831..d25cfb637 100644
--- a/test/test/CompilerTest.scala
+++ b/test/test/CompilerTest.scala
@@ -22,12 +22,26 @@ class CompilerTest extends DottyTest {
def compileFile(prefix: String, fileName: String, args: List[String] = Nil, xerrors: Int = 0): Unit =
compileArgs((s"$prefix$fileName.scala" :: args).toArray, xerrors)
- def compileDir(path: String, args: List[String] = Nil, xerrors: Int = 0): Unit = {
- val dir = Directory(path)
+ def compileDir(path: String, args: List[String] = Nil, xerrors: Int = 0): Unit =
+ compileDir(Directory(path), args, xerrors)
+
+ def compileDir(dir: Directory, args: List[String], xerrors: Int): Unit = {
val fileNames = dir.files.toArray.map(_.toString).filter(_ endsWith ".scala")
compileArgs(fileNames ++ args, xerrors)
}
+ def compileFiles(path: String, args: List[String] = Nil): Unit = {
+ val dir = Directory(path)
+ val fileNames = dir.files.toArray.map(_.toString).filter(_ endsWith ".scala")
+ for (name <- fileNames) {
+ println(s"testing $name")
+ compileArgs((name :: args).toArray, 0)
+ }
+ for (subdir <- dir.dirs) {
+ println(s"testing $subdir")
+ compileDir(subdir, args, 0)
+ }
+ }
}
object CompilerText extends App {