Skip to content

Commit 08ab3c4

Browse files
authored
Merge pull request scala#6705 from hrhino/topic/partest-scalac
Runner reads scalac args from file.
2 parents 8b65ff4 + 5728925 commit 08ab3c4

22 files changed

+11
-128
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,7 +512,8 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
512512
val perGroup = if (testFile.isDirectory) {
513513
sources.flatMap(f => readOptionsFile(f changeExtension "flags"))
514514
} else Nil
515-
perTest ++ perGroup
515+
val perFile = toolArgsFor(sources)("scalac")
516+
perTest ++ perGroup ++ perFile
516517
}
517518

518519
// inspect sources for tool args
@@ -532,7 +533,9 @@ class Runner(val testFile: File, val suiteRunner: SuiteRunner, val nestUI: NestU
532533
case s if (p findFirstIn s).nonEmpty => for (m <- p findFirstMatchIn s) yield m group "args"
533534
}
534535
} finally src.close()
535-
args.flatten map argsplitter getOrElse Nil
536+
val parsed = args.flatten map argsplitter getOrElse Nil
537+
// be forgiving of /* scalac: ... */
538+
if (parsed.lastOption contains "*/") parsed.init else parsed
536539
}
537540
files flatMap argsFor
538541
}

test/files/jvm/beanInfo.check

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/files/jvm/xml05.check

Lines changed: 0 additions & 5 deletions
This file was deleted.

test/files/neg/check-dead.check

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
check-dead.scala:7: warning: dead code following this construct
1+
check-dead.scala:8: warning: dead code following this construct
22
def z1 = y1(throw new Exception) // should warn
33
^
4-
check-dead.scala:10: warning: dead code following this construct
4+
check-dead.scala:11: warning: dead code following this construct
55
def z2 = y2(throw new Exception) // should warn
66
^
7-
check-dead.scala:29: warning: dead code following this construct
7+
check-dead.scala:30: warning: dead code following this construct
88
throw new Exception // should warn
99
^
10-
check-dead.scala:33: warning: dead code following this construct
10+
check-dead.scala:34: warning: dead code following this construct
1111
throw new Exception // should warn
1212
^
1313
error: No warnings can be incurred under -Xfatal-warnings.

test/files/neg/check-dead.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/neg/check-dead.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* scalac: -Ywarn-dead-code -Xfatal-warnings */
12
object Other {
23
def oops(msg: String = "xxx"): Nothing = throw new Exception(msg) // should not warn
34
}

test/files/neg/not-possible-cause.check

Lines changed: 0 additions & 9 deletions
This file was deleted.

test/files/neg/t5946.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/pos/t6047.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/pos/t6047.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* scalac: -language:experimental.macros */
12
import scala.reflect.macros.blackbox.Context
23
import java.io.InputStream
34

test/files/run/finalvar.check

Lines changed: 0 additions & 6 deletions
This file was deleted.

test/files/run/t2251.check

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/run/t2251b.check

Lines changed: 0 additions & 8 deletions
This file was deleted.

test/files/run/t3518.check

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/files/run/t3518.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/run/t3647.check

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/run/t4124.check

Lines changed: 0 additions & 4 deletions
This file was deleted.

test/files/run/t4201.check

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/files/run/t4201.flags

Lines changed: 0 additions & 1 deletion
This file was deleted.

test/files/run/t5676.check

Lines changed: 0 additions & 3 deletions
This file was deleted.

test/files/run/t8253.check

Lines changed: 0 additions & 40 deletions
This file was deleted.

test/files/run/t9027.check

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)