summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/compiler/scala/tools/nsc/plugins/Plugin.scala11
-rw-r--r--src/partest/scala/tools/partest/nest/Runner.scala6
2 files changed, 8 insertions, 9 deletions
diff --git a/src/compiler/scala/tools/nsc/plugins/Plugin.scala b/src/compiler/scala/tools/nsc/plugins/Plugin.scala
index b0113f7696..a584a4ed5d 100644
--- a/src/compiler/scala/tools/nsc/plugins/Plugin.scala
+++ b/src/compiler/scala/tools/nsc/plugins/Plugin.scala
@@ -93,15 +93,13 @@ object Plugin {
type AnyClass = Class[_]
/** Use a class loader to load the plugin class.
- *
- * @return `None` on failure
*/
- def load(pd: PluginDescription, loader: ClassLoader): Try[AnyClass] = {
+ def load(classname: String, loader: ClassLoader): Try[AnyClass] = {
Try[AnyClass] {
- loader loadClass pd.classname
+ loader loadClass classname
} recoverWith {
case _: Exception =>
- Failure(new RuntimeException(s"Warning: class not found: ${pd.classname}"))
+ Failure(new RuntimeException(s"Warning: class not found: ${classname}"))
}
}
@@ -137,9 +135,8 @@ object Plugin {
case _ => false
}
val (locs, pds) = ((explicit ::: exploded ::: included) filterNot ignored).unzip
-
val loader = loaderFor(locs.distinct)
- pds filter (_.isSuccess) map (_.get) map (Plugin load (_, loader))
+ (pds filter (_.isSuccess) map (_.get.classname)).distinct map (Plugin load (_, loader))
}
/** Instantiate a plugin class, given the class and
diff --git a/src/partest/scala/tools/partest/nest/Runner.scala b/src/partest/scala/tools/partest/nest/Runner.scala
index 85679ad0b8..01e4f50981 100644
--- a/src/partest/scala/tools/partest/nest/Runner.scala
+++ b/src/partest/scala/tools/partest/nest/Runner.scala
@@ -13,6 +13,7 @@ import java.util.concurrent.TimeUnit.NANOSECONDS
import scala.collection.mutable.ListBuffer
import scala.concurrent.duration.Duration
import scala.io.Codec
+import scala.reflect.internal.FatalError
import scala.sys.process.Process
import scala.tools.nsc.Properties.{ envOrElse, isWin, jdkHome, javaHome, propOrElse, propOrEmpty, setProp }
import scala.tools.nsc.{ Settings, CompilerCommand, Global }
@@ -451,9 +452,10 @@ class Runner(val testFile: File, fileManager: FileManager, val testRunParams: Te
val failing = rounds find (x => nextTestActionExpectTrue("compilation failed", x.isOk) == false)
// which means passing if it checks and didn't crash the compiler
+ // or, OK, we'll let you crash the compiler with a FatalError if you supply a check file
def checked(r: CompileRound) = r.result match {
- case f: Crash => false
- case f => normalizeLog(); diffIsOk
+ case Crash(_, t, _) if !checkFile.canRead || !t.isInstanceOf[FatalError] => false
+ case _ => normalizeLog(); diffIsOk
}
failing map (checked) getOrElse nextTestActionFailing("expected compilation failure")