Skip to content

Commit 4ab66d1

Browse files
committed
SI-7494 Tests for status quo
Exploit SI-6446 fix to move old pending tests for plugins to the active pool. Also, nuance the partest runner to allow the compiler to crash with a FatalError if a check file is present. Some of the plugin tests make phase assembly throw. One of the legacy tests was moved back to pending: There seems to be a race for who shall be deemed truly dependent. Back to pending for you! apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/ Selected 1 tests drawn from specified tests > starting 1 test in neg ok 1 - neg/t7494-cyclic-dependency 1/1 passed (elapsed time: 00:00:04) Test Run PASSED apm@mara:~/projects/snytt/test$ ./partest files/neg/t7494-cyclic-dependency/ Selected 1 tests drawn from specified tests > starting 1 test in neg !! 1 - neg/t7494-cyclic-dependency [output differs] > 0/1 passed, 1 failed in neg >>>>> Transcripts from failed tests >>>>> > partest files/neg/t7494-cyclic-dependency % scalac t7494-cyclic-dependency/ThePlugin.scala % scalac t7494-cyclic-dependency/sample_2.scala error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! % diff files/neg/t7494-cyclic-dependency-neg.log files/neg/t7494-cyclic-dependency.check @@ -1 +1 @@ -error: Cycle in compiler phase dependencies detected, phase cyclicdependency1 reacted twice! +error: Cycle in compiler phase dependencies detected, phase cyclicdependency2 reacted twice! 0/1 passed, 1 failed (elapsed time: 00:00:04) Test Run FAILED
1 parent e0bd62c commit 4ab66d1

File tree

63 files changed

+133
-143
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+133
-143
lines changed

src/partest/scala/tools/partest/nest/Runner.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import java.util.concurrent.TimeUnit.NANOSECONDS
1313
import scala.collection.mutable.ListBuffer
1414
import scala.concurrent.duration.Duration
1515
import scala.io.Codec
16+
import scala.reflect.internal.FatalError
1617
import scala.sys.process.Process
1718
import scala.tools.nsc.Properties.{ envOrElse, isWin, jdkHome, javaHome, propOrElse, propOrEmpty, setProp }
1819
import scala.tools.nsc.{ Settings, CompilerCommand, Global }
@@ -451,9 +452,10 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
451452
val failing = rounds find (x => nextTestActionExpectTrue("compilation failed", x.isOk) == false)
452453

453454
// which means passing if it checks and didn't crash the compiler
455+
// or, OK, we'll let you crash the compiler with a FatalError if you supply a check file
454456
def checked(r: CompileRound) = r.result match {
455-
case f: Crash => false
456-
case f => normalizeLog(); diffIsOk
457+
case Crash(_, t, _) if !checkFile.canRead || !t.isInstanceOf[FatalError] => false
458+
case _ => normalizeLog(); diffIsOk
457459
}
458460

459461
failing map (checked) getOrElse nextTestActionFailing("expected compilation failure")
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xplugin:. -Xplugin-require:afterterminal
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
package sample
3+
4+
// just a sample that is compiled with the sample plugin enabled
5+
object Sample extends App {
6+
}
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<plugin>
2-
<name>beforeparser</name>
2+
<name>ignored</name>
33
<classname>scala.test.plugins.ThePlugin</classname>
44
</plugin>
55

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Xplugin:. -Xplugin-require:beforeparser
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
2+
package sample
3+
4+
// just a sample that is compiled with the sample plugin enabled
5+
object Sample extends App {
6+
}

0 commit comments

Comments
 (0)