From cd345b43378a24a75a78d699546a1f8964efc88f Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Tue, 14 Mar 2017 16:38:33 +0100 Subject: Add run testing capabilities --- .../test/dotty/tools/dotc/CompilationTests.scala | 34 +++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) (limited to 'compiler/test/dotty/tools/dotc/CompilationTests.scala') diff --git a/compiler/test/dotty/tools/dotc/CompilationTests.scala b/compiler/test/dotty/tools/dotc/CompilationTests.scala index 22f7e6d91..c5c710ab1 100644 --- a/compiler/test/dotty/tools/dotc/CompilationTests.scala +++ b/compiler/test/dotty/tools/dotc/CompilationTests.scala @@ -6,13 +6,36 @@ import org.junit.Test import java.io.{ File => JFile } class CompilationTests extends ParallelTesting { - import CompilationTests.{ defaultOutputDir, defaultOptions } + import CompilationTests.{ defaultOutputDir, defaultOptions, picklingOptions } + + // Positive tests ------------------------------------------------------------ @Test def compilePos = compileFilesInDir("../tests/pos", defaultOptions).pos + // Negative tests ------------------------------------------------------------ + @Test def compileNeg = compileShallowFilesInDir("../tests/neg", defaultOptions).neg + + // Run tests ----------------------------------------------------------------- + + @Test def runArraycopy = + compileFile("../tests/run/arraycopy.scala", defaultOptions).run + + @Test def runAll = + compileFilesInDir("../tests/run", defaultOptions).run + + // Pickling Tests ------------------------------------------------------------ + + @Test def testPickling = + compileFilesInDir("../tests/pickling", picklingOptions).pos + + @Test def testPicklingAst = + compileFilesInDir("../compiler/src/dotty/tools/dotc/ast", picklingOptions).pos + + @Test def testPicklingInf = + compileFile("../tests/pos/pickleinf.scala", picklingOptions).pos } object CompilationTests { @@ -58,4 +81,13 @@ object CompilationTests { private val yCheckOptions = Array("-Ycheck:tailrec,resolveSuper,mixin,restoreScopes,labelDef") val defaultOptions = noCheckOptions ++ checkOptions ++ yCheckOptions ++ classPath + val allowDeepSubtypes = defaultOptions diff Array("-Yno-deep-subtypes") + val allowDoubleBindings = defaultOptions diff Array("-Yno-double-bindings") + + val picklingOptions = defaultOptions ++ Array( + "-Xprint-types", + "-Ytest-pickler", + "-Ystop-after:pickler", + "-Yprintpos" + ) } -- cgit v1.2.3