Skip to content
This repository was archived by the owner on Sep 8, 2022. It is now read-only.

Commit bb1c1f4

Browse files
committed
Merge pull request #38 from SethTisue/enable-fatal-warnings
enable -Xfatal-warnings
2 parents 332df54 + 3a98019 commit bb1c1f4

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

build.sbt

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,16 @@ scalaXmlVersion := "1.0.4"
2222

2323
scalaCheckVersion := "1.11.6"
2424

25-
// TODO: enable "-Xfatal-warnings" for nightlies,
26-
// off by default because we don't want to break scala/scala pr validation due to deprecation
27-
// don't use for doc scope, scaladoc warnings are not to be reckoned with
28-
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-feature", "-deprecation", "-unchecked", "-Xlint")
25+
// TODO: eliminate "-deprecation:false" for nightlies,
26+
// included by default because we don't want to break scala/scala pr validation
27+
scalacOptions ++=
28+
Seq("-feature", "-deprecation:false", "-unchecked", "-Xlint", "-Xfatal-warnings") ++
29+
(CrossVersion.partialVersion(scalaVersion.value) match {
30+
case Some((2, scalaMajor)) if scalaMajor < 12 =>
31+
Seq("-optimize")
32+
case _ =>
33+
Seq() // maybe "-Yopt:l:classpath" eventually?
34+
})
2935

3036
// dependencies
3137
// versions involved in integration builds / that change frequently should be keys, set above!

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
312312
*
313313
* File paths are detected using the absolute path of the test root.
314314
* A string that looks like a file path is normalized by replacing
315-
* the leading segments (the root) with "$ROOT" and by replacing
315+
* the leading segments (the root) with "\$ROOT" and by replacing
316316
* any Windows backslashes with the one true file separator char.
317317
*/
318318
def normalizeLog() {
@@ -765,7 +765,7 @@ class SuiteRunner(
765765

766766
def banner = {
767767
val baseDir = fileManager.compilerUnderTest.parent.toString
768-
def relativize(path: String) = path.replace(baseDir, "$baseDir").replace(PathSettings.srcDir.toString, "$sourceDir")
768+
def relativize(path: String) = path.replace(baseDir, s"$$baseDir").replace(PathSettings.srcDir.toString, "$sourceDir")
769769
val vmBin = javaHome + fileSeparator + "bin"
770770
val vmName = "%s (build %s, %s)".format(javaVmName, javaVmVersion, javaVmInfo)
771771

0 commit comments

Comments
 (0)