Skip to content

Commit

Permalink
Merge pull request scala#8056 from martijnhoekstra/testkit
Browse files Browse the repository at this point in the history
allow publishing testkit
  • Loading branch information
SethTisue authored Jun 18, 2019
2 parents c1be65a + bcdf12c commit 36746c6
Show file tree
Hide file tree
Showing 4 changed files with 50 additions and 13 deletions.
23 changes: 12 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,6 @@ lazy val partest = configureAsSubproject(project)

lazy val scalacheckLib = project.in(file("src") / "scalacheck")
.dependsOn(library)
.settings(clearSourceAndResourceDirectories)
.settings(commonSettings)
.settings(disableDocs)
.settings(skip in publish := true)
Expand All @@ -560,7 +559,6 @@ lazy val scalacheckLib = project.in(file("src") / "scalacheck")
// An instrumented version of BoxesRunTime and ScalaRunTime for partest's "specialized" test category
lazy val specLib = project.in(file("test") / "instrumented")
.dependsOn(library, reflect, compiler)
.settings(clearSourceAndResourceDirectories)
.settings(commonSettings)
.settings(disableDocs)
.settings(skip in publish := true)
Expand Down Expand Up @@ -609,22 +607,26 @@ lazy val bench = project.in(file("test") / "benchmarks")
).settings(inConfig(JmhPlugin.JmhKeys.Jmh)(scalabuild.JitWatchFilePlugin.jitwatchSettings))


lazy val testkit = project.in(file("src") / "testkit")
lazy val testkit = configureAsSubproject(project)
.dependsOn(library)
.settings(clearSourceAndResourceDirectories)
.settings(commonSettings)
.settings(disableDocs)
.settings(skip in publish := true)
.settings(Osgi.settings)
.settings(AutomaticModuleName.settings("scala.testkit"))
.settings(
name := "scala-testkit",
description := "Scala Compiler Testkit",
scalacOptions += "-feature",
libraryDependencies ++= Seq(junitDep, asmDep),
unmanagedSourceDirectories in Compile := List(baseDirectory.value),
fixPom(
"/project/name" -> <name>Scala Testkit</name>,
"/project/description" -> <description>Scala Compiler Testing Tool</description>,
"/project/packaging" -> <packaging>jar</packaging>
)
)


lazy val junit = project.in(file("test") / "junit")
.dependsOn(testkit, compiler, replFrontend, scaladoc)
.settings(clearSourceAndResourceDirectories)
.settings(commonSettings)
//.settings(scalacOptions in Compile += "-Xlint:-nullary-unit,-adapted-args")
.settings(disableDocs)
Expand All @@ -644,7 +646,6 @@ lazy val junit = project.in(file("test") / "junit")

lazy val scalacheck = project.in(file("test") / "scalacheck")
.dependsOn(library, reflect, compiler, scaladoc, scalacheckLib)
.settings(clearSourceAndResourceDirectories)
.settings(commonSettings)
.settings(disableDocs)
.settings(skip in publish := true)
Expand Down Expand Up @@ -675,7 +676,6 @@ lazy val osgiTestEclipse = osgiTestProject(

def osgiTestProject(p: Project, framework: ModuleID) = p
.dependsOn(library, reflect, compiler)
.settings(clearSourceAndResourceDirectories)
.settings(commonSettings)
.settings(disableDocs)
.settings(skip in publish := true)
Expand Down Expand Up @@ -956,7 +956,7 @@ lazy val root: Project = (project in file("."))
setIncOptions
)
.aggregate(library, reflect, compiler, interactive, repl, replFrontend,
scaladoc, scalap, partest, junit, scalaDist).settings(
scaladoc, scalap, testkit, partest, junit, scalaDist).settings(
sources in Compile := Seq.empty,
onLoadMessage := """|*** Welcome to the sbt build definition for Scala! ***
|Check README.md for more information.""".stripMargin
Expand Down Expand Up @@ -1137,6 +1137,7 @@ intellij := {
moduleDeps(junit).value,
moduleDeps(library).value,
moduleDeps(manual).value,
moduleDeps(testkit).value,
moduleDeps(partest).value,
moduleDeps(partestJavaAgent).value,
moduleDeps(reflect).value,
Expand Down
12 changes: 12 additions & 0 deletions src/testkit/scala/tools/testkit/AllocationTest.scala
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

package scala.tools.testkit

import java.lang.management.ManagementFactory
Expand Down
14 changes: 13 additions & 1 deletion src/testkit/scala/tools/testkit/AssertUtil.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
package scala.tools.testkit
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

package scala.tools.testkit

import org.junit.Assert, Assert._
import scala.reflect.ClassTag
Expand Down
14 changes: 13 additions & 1 deletion src/testkit/scala/tools/testkit/TempDir.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
package scala.tools.testkit
/*
* Scala (https://www.scala-lang.org)
*
* Copyright EPFL and Lightbend, Inc.
*
* Licensed under Apache License 2.0
* (http://www.apache.org/licenses/LICENSE-2.0).
*
* See the NOTICE file distributed with this work for
* additional information regarding copyright ownership.
*/

package scala.tools.testkit

import java.io.{IOException, File}

Expand Down

0 comments on commit 36746c6

Please sign in to comment.