diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2017-03-23 14:09:48 +0100 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2017-03-29 10:33:26 +0200 |
commit | 41b3641aa89fa6121f6b89807d5a030b6f382d0c (patch) | |
tree | 0003e7412895df3bf0073c0530760845a359fc31 /compiler/test/dotty/tools/dotc/ParallelTestTests.scala | |
parent | f2608946e38958b854f0178aa1b84f31d41ff399 (diff) | |
download | dotty-41b3641aa89fa6121f6b89807d5a030b6f382d0c.tar.gz dotty-41b3641aa89fa6121f6b89807d5a030b6f382d0c.tar.bz2 dotty-41b3641aa89fa6121f6b89807d5a030b6f382d0c.zip |
Add testing of new test framework
Diffstat (limited to 'compiler/test/dotty/tools/dotc/ParallelTestTests.scala')
-rw-r--r-- | compiler/test/dotty/tools/dotc/ParallelTestTests.scala | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/compiler/test/dotty/tools/dotc/ParallelTestTests.scala b/compiler/test/dotty/tools/dotc/ParallelTestTests.scala new file mode 100644 index 000000000..572f63410 --- /dev/null +++ b/compiler/test/dotty/tools/dotc/ParallelTestTests.scala @@ -0,0 +1,51 @@ +package dotty +package tools +package dotc + +import org.junit.Assert._ +import org.junit.Test + +import scala.util.control.NonFatal + +class ParallelTestTests extends ParallelTesting { + import CompilationTests._ + + def interactive: Boolean = !sys.env.contains("DRONE") + + @Test def missingFile: Unit = + try { + compileFile("../tests/partest-test/i-dont-exist.scala", defaultOptions).expectFailure.neg() + fail("didn't fail properly") + } + catch { + case _: IllegalArgumentException => // pass! + case NonFatal(_) => fail("wrong exception thrown") + } + + @Test def pos1Error: Unit = + compileFile("../tests/partest-test/posFail1Error.scala", defaultOptions).expectFailure.pos() + + @Test def negMissingAnnot: Unit = + compileFile("../tests/partest-test/negMissingAnnot.scala", defaultOptions).expectFailure.neg() + + @Test def negAnnotWrongLine: Unit = + compileFile("../tests/partest-test/negAnnotWrongLine.scala", defaultOptions).expectFailure.neg() + + @Test def negTooManyAnnots: Unit = + compileFile("../tests/partest-test/negTooManyAnnots.scala", defaultOptions).expectFailure.neg() + + @Test def negNoPositionAnnot: Unit = + compileFile("../tests/partest-test/negNoPositionAnnots.scala", defaultOptions).expectFailure.neg() + + @Test def runCompileFail: Unit = + compileFile("../tests/partest-test/posFail1Error.scala", defaultOptions).expectFailure.run() + + @Test def runWrongOutput1: Unit = + compileFile("../tests/partest-test/runWrongOutput1.scala", defaultOptions).expectFailure.run() + + @Test def runWrongOutput2: Unit = + compileFile("../tests/partest-test/runWrongOutput2.scala", defaultOptions).expectFailure.run() + + @Test def runDiffOutput1: Unit = + compileFile("../tests/partest-test/runDiffOutput1.scala", defaultOptions).expectFailure.run() +} |