From 4ab66d1613da276712692001ed8f9f3c009736ab Mon Sep 17 00:00:00 2001 From: Som Snytt Date: Sat, 18 May 2013 08:46:43 -0700 Subject: 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 --- .../neg/t7494-right-after-terminal/ThePlugin.scala | 32 ++++++++++++++++++++++ .../neg/t7494-right-after-terminal/sample_2.flags | 1 + .../neg/t7494-right-after-terminal/sample_2.scala | 6 ++++ .../t7494-right-after-terminal/scalac-plugin.xml | 5 ++++ 4 files changed, 44 insertions(+) create mode 100644 test/files/neg/t7494-right-after-terminal/ThePlugin.scala create mode 100644 test/files/neg/t7494-right-after-terminal/sample_2.flags create mode 100644 test/files/neg/t7494-right-after-terminal/sample_2.scala create mode 100644 test/files/neg/t7494-right-after-terminal/scalac-plugin.xml (limited to 'test/files/neg/t7494-right-after-terminal') diff --git a/test/files/neg/t7494-right-after-terminal/ThePlugin.scala b/test/files/neg/t7494-right-after-terminal/ThePlugin.scala new file mode 100644 index 0000000000..9d6d30b327 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/ThePlugin.scala @@ -0,0 +1,32 @@ +package scala.test.plugins + +import scala.tools.nsc +import nsc.Global +import nsc.Phase +import nsc.plugins.Plugin +import nsc.plugins.PluginComponent + +class ThePlugin(val global: Global) extends Plugin { + import global._ + + val name = "rightafterterminal" + val description = "Declares one plugin that wants to be right after the terminal phase" + val components = List[PluginComponent](thePhase) + + private object thePhase extends PluginComponent { + val global = ThePlugin.this.global + + val runsAfter = List[String]() + override val runsRightAfter = Some("terminal") + + val phaseName = ThePlugin.this.name + + def newPhase(prev: Phase) = new ThePhase(prev) + } + + private class ThePhase(prev: Phase) extends Phase(prev) { + def name = ThePlugin.this.name + def run {} + } +} + diff --git a/test/files/neg/t7494-right-after-terminal/sample_2.flags b/test/files/neg/t7494-right-after-terminal/sample_2.flags new file mode 100644 index 0000000000..da046ba5f1 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/sample_2.flags @@ -0,0 +1 @@ +-Xplugin:. -Xplugin-require:rightafterterminal diff --git a/test/files/neg/t7494-right-after-terminal/sample_2.scala b/test/files/neg/t7494-right-after-terminal/sample_2.scala new file mode 100644 index 0000000000..73cdc64e40 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/sample_2.scala @@ -0,0 +1,6 @@ + +package sample + +// just a sample that is compiled with the sample plugin enabled +object Sample extends App { +} diff --git a/test/files/neg/t7494-right-after-terminal/scalac-plugin.xml b/test/files/neg/t7494-right-after-terminal/scalac-plugin.xml new file mode 100644 index 0000000000..2558d6fd03 --- /dev/null +++ b/test/files/neg/t7494-right-after-terminal/scalac-plugin.xml @@ -0,0 +1,5 @@ + + ignored + scala.test.plugins.ThePlugin + + -- cgit v1.2.3