diff options
author | James Iry <james.iry@typesafe.com> | 2013-06-04 10:22:43 -0700 |
---|---|---|
committer | James Iry <james.iry@typesafe.com> | 2013-06-04 10:22:43 -0700 |
commit | ac4e3ca19246ae3d983f99607b865c5ed3acb2b9 (patch) | |
tree | 71df59ffda407ea0e527aeec3cea38fe7edc4043 /test/files/run/t7398.scala | |
parent | fc6da8d8b765ddc3c492d0884164561ca7a8b4d8 (diff) | |
download | scala-ac4e3ca19246ae3d983f99607b865c5ed3acb2b9.tar.gz scala-ac4e3ca19246ae3d983f99607b865c5ed3acb2b9.tar.bz2 scala-ac4e3ca19246ae3d983f99607b865c5ed3acb2b9.zip |
Refactor testing logic for only running under certain JDK versions
We had several tests designed to only run if the JDK version was at
least some specified version. This commit refactors that common logic
into DirectTest.
Diffstat (limited to 'test/files/run/t7398.scala')
-rw-r--r-- | test/files/run/t7398.scala | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/test/files/run/t7398.scala b/test/files/run/t7398.scala index e4090f7db3..dd59697b71 100644 --- a/test/files/run/t7398.scala +++ b/test/files/run/t7398.scala @@ -3,14 +3,11 @@ import scala.tools.partest._ object Test extends CompilerTest { import global._ - def javaVersion = scala.util.Properties.javaVersion - def isJavaEight = javaVersion startsWith "1.8" // This way we auto-pass on non-java8 since there's nothing to check - override lazy val units = { - val res: List[CompilationUnit] = if (isJavaEight) javaCompilationUnits(global)(defaultMethodSource) else Nil - val word = if (isJavaEight) "Attempting" else "Skipping" - log(s"$word java8-specific test under java version $javaVersion") - res + override lazy val units: List[CompilationUnit] = testUnderJavaAtLeast("1.8") { + javaCompilationUnits(global)(defaultMethodSource) + } otherwise { + Nil } private def defaultMethodSource = """ |