Skip to content

Commit

Permalink
Merge pull request #10059 from scala/revert-10056-topic/partest-relea…
Browse files Browse the repository at this point in the history
…se-8

Revert "Partest uses -release 8"
  • Loading branch information
lrytz committed Jun 24, 2022
2 parents 6582378 + 443262f commit 69ac276
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 21 deletions.
11 changes: 3 additions & 8 deletions src/partest/scala/tools/partest/nest/Runner.scala
Original file line number Diff line number Diff line change
Expand Up @@ -453,15 +453,10 @@ class Runner(val testInfo: TestInfo, val suiteRunner: AbstractRunner) {
}

// all sources in a round may contribute flags via // scalac: -flags
// if a javaVersion isn't specified, require the minimum viable using -release 8 to avoid gotcha in CI.
def flagsForCompilation(sources: List[File]): List[String] = {
import scala.util.Properties.isJavaAtLeast
var perFile = toolArgsFor(sources)("scalac")
if (parentFile.getParentFile.getName == "macro-annot")
perFile ::= "-Ymacro-annotations"
if (isJavaAtLeast(9) && !perFile.exists(_.startsWith("-release")) && toolArgsFor(sources)("javaVersion", split = false).isEmpty)
perFile :::= List("-release", "8")
perFile
val perFile = toolArgsFor(sources)("scalac")
if (parentFile.getParentFile.getName == "macro-annot") "-Ymacro-annotations" :: perFile
else perFile
}

// inspect sources for tool args
Expand Down
7 changes: 0 additions & 7 deletions test/files/neg/choices.check
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
#partest java9+
error: Usage: -Yresolve-term-conflict:<strategy> where <strategy> choices are package, object, error (default: error).
error: bad option: '-Yresolve-term-conflict'
error: bad options: -release 8 -Yresolve-term-conflict
error: flags file may only contain compiler options, found: -Yresolve-term-conflict
4 errors
#partest java8
error: Usage: -Yresolve-term-conflict:<strategy> where <strategy> choices are package, object, error (default: error).
error: bad option: '-Yresolve-term-conflict'
error: bad options: -Yresolve-term-conflict
Expand Down
6 changes: 0 additions & 6 deletions test/files/neg/partestInvalidFlag.check
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
#partest java9+
error: bad option: '-badCompilerFlag'
error: bad options: -release 8 -badCompilerFlag notAFlag -opt:badChoice
error: flags file may only contain compiler options, found: -badCompilerFlag notAFlag -opt:badChoice
3 errors
#partest java8
error: bad option: '-badCompilerFlag'
error: bad options: -badCompilerFlag notAFlag -opt:badChoice
error: flags file may only contain compiler options, found: -badCompilerFlag notAFlag -opt:badChoice
Expand Down

0 comments on commit 69ac276

Please sign in to comment.