Skip to content

Commit 6901521

Browse files
authored
Merge pull request scala#6566 from lrytz/inPartest
In-source partest [ci: last-only]
2 parents 9b908a1 + e253ad1 commit 6901521

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+2768
-108
lines changed

build.sbt

+25-24
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,15 @@ import scala.build._
3939
import VersionUtil._
4040
import scala.tools.nsc.util.ScalaClassLoader.URLClassLoader
4141

42-
// Scala dependencies:
43-
val partestDep = scalaDep("org.scala-lang.modules", "scala-partest", versionProp = "partest")
44-
4542
// Non-Scala dependencies:
46-
val junitDep = "junit" % "junit" % "4.11"
47-
val junitInterfaceDep = "com.novocode" % "junit-interface" % "0.11" % "test"
48-
val scalacheckDep = "org.scala-lang.modules" % "scalacheck_2.13.0-M4-pre-20d3c21" % "1.14.0-newCollections" % "test"
49-
val jolDep = "org.openjdk.jol" % "jol-core" % "0.5"
50-
val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version")
51-
val jlineDep = "jline" % "jline" % versionProps("jline.version")
43+
val junitDep = "junit" % "junit" % "4.11"
44+
val junitInterfaceDep = "com.novocode" % "junit-interface" % "0.11" % "test"
45+
val scalacheckDep = "org.scala-lang.modules" % "scalacheck_2.13.0-M4-pre-20d3c21" % "1.14.0-newCollections" % "test"
46+
val jolDep = "org.openjdk.jol" % "jol-core" % "0.5"
47+
val asmDep = "org.scala-lang.modules" % "scala-asm" % versionProps("scala-asm.version")
48+
val jlineDep = "jline" % "jline" % versionProps("jline.version")
49+
val testInterfaceDep = "org.scala-sbt" % "test-interface" % "1.0"
50+
val diffUtilsDep = "com.googlecode.java-diff-utils" % "diffutils" % "1.3.0"
5251

5352
val partestDependencies = Seq(
5453
"annotations" -> "02fe2ed93766323a13f22c7a7e2ecdcd84259b6c",
@@ -552,18 +551,20 @@ lazy val scalap = configureAsSubproject(project)
552551
)
553552
.dependsOn(compiler)
554553

555-
lazy val partestExtras = Project("partest-extras", file(".") / "src" / "partest-extras")
556-
.dependsOn(replFrontend, scaladoc)
557-
.settings(commonSettings)
558-
.settings(generatePropertiesFileSettings)
559-
.settings(clearSourceAndResourceDirectories)
554+
lazy val partest = configureAsSubproject(project)
555+
.dependsOn(library, reflect, compiler, scalap, replFrontend, scaladoc)
560556
.settings(disableDocs)
561-
.settings(disablePublishing)
557+
.settings(Osgi.settings)
558+
.settings(AutomaticModuleName.settings("scala.partest"))
562559
.settings(
563-
name := "scala-partest-extras",
564-
description := "Scala Compiler Testing Tool (compiler-specific extras)",
565-
libraryDependencies += partestDep,
566-
unmanagedSourceDirectories in Compile := List(baseDirectory.value)
560+
name := "scala-partest",
561+
description := "Scala Compiler Testing Tool",
562+
libraryDependencies ++= List(testInterfaceDep, diffUtilsDep),
563+
fixPom(
564+
"/project/name" -> <name>Scala Partest</name>,
565+
"/project/description" -> <description>Scala Compiler Testing Tool</description>,
566+
"/project/packaging" -> <packaging>jar</packaging>
567+
)
567568
)
568569

569570
lazy val bench = project.in(file("test") / "benchmarks")
@@ -579,7 +580,7 @@ lazy val bench = project.in(file("test") / "benchmarks")
579580
)
580581

581582
lazy val junit = project.in(file("test") / "junit")
582-
.dependsOn(library, reflect, compiler, partestExtras, scaladoc)
583+
.dependsOn(library, reflect, compiler, partest, scaladoc)
583584
.settings(clearSourceAndResourceDirectories)
584585
.settings(commonSettings)
585586
.settings(disableDocs)
@@ -703,15 +704,15 @@ lazy val partestJavaAgent = Project("partest-javaagent", file(".") / "src" / "pa
703704
)
704705

705706
lazy val test = project
706-
.dependsOn(compiler, interactive, replFrontend, scalap, partestExtras, partestJavaAgent, scaladoc)
707+
.dependsOn(compiler, interactive, replFrontend, scalap, partest, partestJavaAgent, scaladoc)
707708
.disablePlugins(plugins.JUnitXmlReportPlugin)
708709
.configs(IntegrationTest)
709710
.settings(commonSettings)
710711
.settings(disableDocs)
711712
.settings(disablePublishing)
712713
.settings(Defaults.itSettings)
713714
.settings(
714-
libraryDependencies ++= Seq(asmDep, partestDep),
715+
libraryDependencies ++= Seq(asmDep),
715716
libraryDependencies ++= partestDependencies,
716717
// no main sources
717718
sources in Compile := Seq.empty,
@@ -926,7 +927,7 @@ lazy val root: Project = (project in file("."))
926927
}
927928
)
928929
.aggregate(library, reflect, compiler, interactive, repl, replFrontend,
929-
scaladoc, scalap, partestExtras, junit, scalaDist, macroAnnot).settings(
930+
scaladoc, scalap, partest, junit, scalaDist, macroAnnot).settings(
930931
sources in Compile := Seq.empty,
931932
onLoadMessage := """|*** Welcome to the sbt build definition for Scala! ***
932933
|Check README.md for more information.""".stripMargin
@@ -1102,7 +1103,7 @@ intellij := {
11021103
moduleDeps(junit).value,
11031104
moduleDeps(library).value,
11041105
moduleDeps(manual).value,
1105-
moduleDeps(partestExtras).value,
1106+
moduleDeps(partest).value,
11061107
moduleDeps(partestJavaAgent).value,
11071108
moduleDeps(reflect).value,
11081109
moduleDeps(repl).value,

project/PartestUtil.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ object PartestUtil {
3535
val knownUnaryOptions = List(
3636
"--pos", "--neg", "--run", "--jvm", "--res", "--ant", "--scalap", "--specialized",
3737
"--instrumented", "--presentation", "--failed", "--update-check",
38-
"--show-diff", "--show-log", "--verbose", "--terse", "--debug", "--version", "--self-test", "--help")
38+
"--show-diff", "--show-log", "--verbose", "--terse", "--debug", "--version", "--help")
3939
val srcPathOption = "--srcpath"
4040
val grepOption = "--grep"
4141

project/VersionUtil.scala

-13
Original file line numberDiff line numberDiff line change
@@ -169,19 +169,6 @@ object VersionUtil {
169169
}
170170
}
171171

172-
/** Get a subproject version number from `versionProps` */
173-
def versionNumber(name: String): String =
174-
versionProps(s"$name.version.number")
175-
176-
/** Build a dependency to a Scala module with the given group and artifact ID */
177-
def scalaDep(group: String, artifact: String, versionProp: String = null, scope: String = null, compatibility: String = "binary") = {
178-
val vp = if(versionProp eq null) artifact else versionProp
179-
val m = group % (artifact + "_" + versionProps(s"scala.$compatibility.version")) % versionNumber(vp)
180-
val m2 = if(scope eq null) m else m % scope
181-
// exclusion of the scala-library transitive dependency avoids eviction warnings during `update`:
182-
m2.exclude("org.scala-lang", "*")
183-
}
184-
185172
private def bootstrapOrganization(path: String) =
186173
"org.scala-lang.scala-sha-bootstrap." + path.replace('/', '.')
187174

src/intellij/junit.iml.SAMPLE

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<orderEntry type="module" module-name="repl-frontend" />
1717
<orderEntry type="module" module-name="interactive" />
1818
<orderEntry type="module" module-name="scaladoc" />
19-
<orderEntry type="module" module-name="partest-extras" />
19+
<orderEntry type="module" module-name="partest" />
2020
<orderEntry type="library" name="junit-deps" level="project" />
2121
<orderEntry type="library" name="starr" level="project" />
2222
</component>
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<module type="JAVA_MODULE" version="4">
33
<component name="NewModuleRootManager">
4-
<output url="file://$MODULE_DIR$/../../build/quick/classes/partest-extras" />
5-
<output-test url="file://$MODULE_DIR$/../../out/test/partest-extras" />
4+
<output url="file://$MODULE_DIR$/../../build/quick/classes/partest" />
5+
<output-test url="file://$MODULE_DIR$/../../out/test/partest" />
66
<exclude-output />
7-
<content url="file://$MODULE_DIR$/../partest-extras">
8-
<sourceFolder url="file://$MODULE_DIR$/../partest-extras" isTestSource="false" />
7+
<content url="file://$MODULE_DIR$/../partest">
8+
<sourceFolder url="file://$MODULE_DIR$/../partest" isTestSource="false" />
99
</content>
1010
<orderEntry type="inheritedJdk" />
1111
<orderEntry type="sourceFolder" forTests="false" />
1212
<orderEntry type="module" module-name="library" />
1313
<orderEntry type="module" module-name="reflect" />
1414
<orderEntry type="module" module-name="compiler" />
15+
<orderEntry type="module" module-name="scalap" />
1516
<orderEntry type="module" module-name="scaladoc" />
1617
<orderEntry type="module" module-name="repl" />
1718
<orderEntry type="module" module-name="repl-frontend" />
19+
<orderEntry type="library" name="partest-deps" level="project" />
1820
<orderEntry type="library" name="starr" level="project" />
19-
<orderEntry type="library" name="partest-extras-deps" level="project" />
2021
</component>
2122
</module>

0 commit comments

Comments
 (0)