diff options
author | vsalvis <salvisbergvera@gmail.com> | 2015-04-15 14:34:53 +0200 |
---|---|---|
committer | vsalvis <salvisbergvera@gmail.com> | 2015-04-17 18:13:44 +0200 |
commit | 8d08915765848d1370542742c8b7482bd1bf86d0 (patch) | |
tree | f8a794ba285e0eff28930cffe21cf7956aa9371b /test/dotty/partest/DPConfig.scala | |
parent | 85b48de299fcdba17397c59c9bcaa0a69da93350 (diff) | |
download | dotty-8d08915765848d1370542742c8b7482bd1bf86d0.tar.gz dotty-8d08915765848d1370542742c8b7482bd1bf86d0.tar.bz2 dotty-8d08915765848d1370542742c8b7482bd1bf86d0.zip |
Partest for Dotty with pos tests and neg tests with error count
Diffstat (limited to 'test/dotty/partest/DPConfig.scala')
-rw-r--r-- | test/dotty/partest/DPConfig.scala | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/test/dotty/partest/DPConfig.scala b/test/dotty/partest/DPConfig.scala new file mode 100644 index 000000000..c744a9562 --- /dev/null +++ b/test/dotty/partest/DPConfig.scala @@ -0,0 +1,31 @@ +package dotty.partest + +import java.io.File +import scala.collection.JavaConversions._ + + +/** Dotty Partest runs all tests in the provided testDirs located under + * testRoot. There can be several directories with pos resp. neg tests, as + * long as the prefix is pos/neg. + * + * Each testDir can also have a __defaultFlags.flags file, which provides + * compiler flags and is used unless there's a specific flags file (e.g. for + * test pos/A.scala, if there's a pos/A.flags file those flags are used, + * otherwise pos/__defaultFlags.flags are used if the file exists). + */ +object DPConfig { + val testRoot = "./tests/partest-generated" + lazy val testDirs = { + val root = new File(testRoot) + val dirs = if (!root.exists) Array.empty[String] else root.listFiles.filter(_.isDirectory).map(_.getName) + if (dirs.length > 0) + println(s"Partest found generated source directories in $testRoot: " + dirs.mkString(", ")) + else + throw new Exception("Partest did not detect any generated sources") + dirs + } + + // Tests finish faster when running in parallel, but console output is + // out of order and sometimes the compiler crashes + val runTestsInParallel = false +} |