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

Commit 90950db

Browse files
committed
Merge pull request #4 from xuwei-k/fix-warnings
fix scalacOptions and warnings
2 parents f1193a7 + 2191fbc commit 90950db

File tree

6 files changed

+13
-19
lines changed

6 files changed

+13
-19
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ scalaVersion := "2.11.0-M5"
3939
scalaBinaryVersion := "2.11.0-M5"
4040

4141
// don't use for doc scope, scaladoc warnings are not to be reckoned with
42-
scalacOptions in compile ++= Seq("-optimize", "-Xfatal-warnings", "-feature", "-deprecation", "-unchecked", "-Xlint")
42+
scalacOptions in (Compile, compile) ++= Seq("-optimize", "-Xfatal-warnings", "-feature", "-deprecation", "-unchecked", "-Xlint")
4343

4444

4545
// Generate $name.properties to store our version as well as the scala version used to build

project/build.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# "0.13.+" breaks plugin resolution
2-
sbt.version=0.13.0-RC5
2+
sbt.version=0.13.0

src/main/scala/scala/tools/partest/DirectTest.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ package scala.tools.partest
77

88
import scala.tools.nsc._
99
import settings.ScalaVersion
10-
import util.{ SourceFile, BatchSourceFile }
10+
import scala.reflect.internal.util.{ SourceFile, BatchSourceFile }
1111
import reporters.{Reporter, ConsoleReporter}
1212
import scala.tools.cmd.CommandLineParser
1313

src/main/scala/scala/tools/partest/TestState.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ object TestState {
5858
def reason = s"caught $caught_s - ${caught.getMessage}"
5959

6060
private def caught_s = (caught.getClass.getName split '.').last
61-
private def stack_s = stackTraceString(caught)
6261
override def transcriptString = nljoin(super.transcriptString, caught_s)
6362
}
6463
}

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

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ import scala.collection.mutable.ListBuffer
1414
import scala.concurrent.duration.Duration
1515
import scala.io.Codec
1616
import scala.reflect.internal.FatalError
17+
import scala.reflect.internal.util.ScalaClassLoader
1718
import scala.sys.process.{ Process, ProcessLogger }
1819
import scala.tools.nsc.Properties.{ envOrElse, isWin, jdkHome, javaHome, propOrElse, propOrEmpty, setProp, versionMsg, javaVmName, javaVmVersion, javaVmInfo }
1920
import scala.tools.nsc.{ Settings, CompilerCommand, Global }
20-
import scala.tools.nsc.io.{ AbstractFile, PlainFile }
21+
import scala.tools.nsc.io.{ AbstractFile }
2122
import scala.tools.nsc.reporters.ConsoleReporter
22-
import scala.tools.nsc.util.{ Exceptional, ScalaClassLoader, stackTraceString }
23+
import scala.tools.nsc.util.{ Exceptional, stackTraceString }
2324
import scala.tools.scalap.Main.decompileScala
2425
import scala.tools.scalap.scalasig.ByteCode
2526
import scala.util.{ Try, Success, Failure }
@@ -58,7 +59,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
5859
def isEnumeratedTest = false
5960

6061
private var _lastState: TestState = null
61-
private var _transcript = new TestTranscript
62+
private val _transcript = new TestTranscript
6263

6364
def lastState = if (_lastState == null) Uninitialized(testFile) else _lastState
6465
def setLastState(s: TestState) = _lastState = s
@@ -79,7 +80,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
7980
type RanOneTest = (Boolean, LogContext)
8081

8182
def showCrashInfo(t: Throwable) {
82-
System.err.println("Crashed running test $testIdent: " + t)
83+
System.err.println(s"Crashed running test $testIdent: " + t)
8384
if (!isPartestTerse)
8485
System.err.println(stackTraceString(t))
8586
}
@@ -454,13 +455,7 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner) {
454455

455456
def fsString = fs map (_.toString stripPrefix parentFile.toString + "/") mkString " "
456457
def isOk = result.isOk
457-
def mkScalacString(): String = {
458-
val flags = file2String(flagsFile) match {
459-
case "" => ""
460-
case s => " " + s
461-
}
462-
s"""scalac $fsString"""
463-
}
458+
def mkScalacString(): String = s"""scalac $fsString"""
464459
override def toString = description + ( if (result.isOk) "" else "\n" + result.status )
465460
}
466461
case class OnlyJava(fs: List[File]) extends CompileRound {
@@ -772,7 +767,7 @@ class SuiteRunner(
772767
if (failed && !runner.logFile.canRead)
773768
runner.genPass()
774769
else {
775-
val (state, elapsed) =
770+
val (state, _) =
776771
try timed(runner.run())
777772
catch {
778773
case t: Throwable => throw new RuntimeException(s"Error running $testFile", t)

src/main/scala/scala/tools/partest/package.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,16 @@ package object partest {
216216

217217
c.Expr(Block(
218218
List(Apply(
219-
Select(Ident(PredefModule), newTermName("println")),
219+
Select(Ident(PredefModule), TermName("println")),
220220
List(Apply(
221221
Select(Apply(
222-
Select(Ident(ScalaPackage), newTermName("StringContext")),
222+
Select(Ident(ScalaPackage), TermName("StringContext")),
223223
List(
224224
Literal(Constant("trace> ")),
225225
Literal(Constant("\\nres: ")),
226226
Literal(Constant(" = ")),
227227
Literal(Constant("\\n")))),
228-
newTermName("s")),
228+
TermName("s")),
229229
List(
230230
Literal(Constant(show(a.tree))),
231231
Literal(Constant(show(a.actualType))),

0 commit comments

Comments
 (0)