Skip to content

Commit a286bd9

Browse files
authored
Move build tool tests to scip-java (#920)
1 parent dcd5824 commit a286bd9

57 files changed

Lines changed: 27 additions & 33 deletions

File tree

Some content is hidden

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

CONTRIBUTING.md

Lines changed: 5 additions & 2 deletions

build.sbt

Lines changed: 16 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,15 @@ lazy val cli = project
182182
// sbt invokes it directly (e.g. from the scip-kotlinc snapshots
183183
// task) so it cannot kill the surrounding sbt process.
184184
Compile / run / fork := true,
185+
Test / fork := true,
186+
// Our CI set up is a couple of measly vCPUs so parallelising tests there makes
187+
// everything worse.
188+
Test / testForkedParallel := !sys.env.contains("CI"),
189+
// The SCIP build tool drives javac in-process; on JDK 17+ this requires
190+
// opening the JDK-internal javac packages.
191+
Test / javaOptions ++= javacModuleOptions.map(_.stripPrefix("-J")),
192+
// Pin the JDK version embedded in stdlib SCIP symbols so output is stable.
193+
Test / javaOptions += "-Dscip.jdk.version=11",
185194
libraryDependencies ++=
186195
List(
187196
"com.github.ajalt.clikt" % "clikt-jvm" % V.clikt,
@@ -195,6 +204,13 @@ lazy val cli = project
195204
"org.jetbrains.kotlin" % "kotlin-scripting-dependencies-maven" %
196205
V.kotlinVersion
197206
),
207+
libraryDependencies ++=
208+
Seq(
209+
"org.jetbrains.kotlin" % "kotlin-test" % V.kotlinVersion % Test,
210+
"org.jetbrains.kotlin" % "kotlin-test-junit5" % V.kotlinVersion % Test,
211+
"com.github.sbt.junit" % "jupiter-interface" %
212+
JupiterKeys.jupiterVersion.value % Test
213+
),
198214
(Compile / resourceGenerators) +=
199215
Def
200216
.task {
@@ -450,32 +466,6 @@ def javacModuleOptions = List(
450466
"-J--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
451467
)
452468

453-
lazy val buildTools = project
454-
.in(file("tests/buildTools"))
455-
.enablePlugins(KotlinPlugin)
456-
.settings(
457-
publish / skip := true,
458-
kotlinVersion := V.kotlinVersion,
459-
kotlincJvmTarget := "11",
460-
Test / fork := true,
461-
// Our CI set up is a couple of measly vCPUs so parallelising tests there makes
462-
// everything worse
463-
Test / testForkedParallel := !sys.env.contains("CI"),
464-
// The SCIP build tool drives javac in-process; on JDK 17+ this requires
465-
// opening the JDK-internal javac packages.
466-
Test / javaOptions ++= javacModuleOptions.map(_.stripPrefix("-J")),
467-
// Pin the JDK version embedded in stdlib SCIP symbols so output is stable.
468-
Test / javaOptions += "-Dscip.jdk.version=11",
469-
libraryDependencies ++=
470-
Seq(
471-
"org.jetbrains.kotlin" % "kotlin-test" % V.kotlinVersion % Test,
472-
"org.jetbrains.kotlin" % "kotlin-test-junit5" % V.kotlinVersion % Test,
473-
"com.github.sbt.junit" % "jupiter-interface" %
474-
JupiterKeys.jupiterVersion.value % Test
475-
)
476-
)
477-
.dependsOn(cli)
478-
479469
lazy val snapshots = project
480470
.in(file("tests/snapshots"))
481471
.settings(

flake.nix

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,25 +53,26 @@
5353
cd ${./.}
5454
# Exclude minimized fixtures and generated SCIP snapshot goldens
5555
# (coupled to exact line/column annotations), the standalone example
56-
# projects, and the buildTools test fixtures: these all mirror
56+
# projects, and the scip-java build-tool test fixtures: these all mirror
5757
# real-world project layouts that must not be reformatted here.
5858
find . -name '*.java' \
5959
-not -path './examples/*' \
6060
-not -path './tests/minimized/*' \
6161
-not -path './tests/snapshots/*' \
62-
-not -path './tests/buildTools/src/test/resources/fixtures/*' \
62+
-not -path './scip-java/src/test/resources/fixtures/*' \
6363
-not -path './scip-kotlinc/minimized/*' \
6464
-exec ${pkgs.google-java-format}/bin/google-java-format --dry-run --set-exit-if-changed {} +
6565
touch $out
6666
'';
6767
ktfmt = pkgs.runCommand "check-ktfmt" { } ''
6868
cd ${./.}
6969
# Exclude minimized Kotlin snapshots (coupled to generated SCIP
70-
# goldens with exact line/column annotations) and the buildTools test
71-
# fixtures (real-world project layouts): neither may be reformatted.
70+
# goldens with exact line/column annotations) and the scip-java
71+
# build-tool test fixtures (real-world project layouts): neither may
72+
# be reformatted.
7273
find . -name '*.kt' \
7374
-not -path './scip-kotlinc/minimized/*' \
74-
-not -path './tests/buildTools/src/test/resources/fixtures/*' \
75+
-not -path './scip-java/src/test/resources/fixtures/*' \
7576
-exec ${pkgs.ktfmt}/bin/ktfmt --kotlinlang-style --dry-run --set-exit-if-changed {} +
7677
touch $out
7778
'';

tests/buildTools/src/test/kotlin/tests/AutoBuildToolTest.kt renamed to scip-java/src/test/kotlin/tests/AutoBuildToolTest.kt

File renamed without changes.

tests/buildTools/src/test/kotlin/tests/BuildToolHarness.kt renamed to scip-java/src/test/kotlin/tests/BuildToolHarness.kt

File renamed without changes.

tests/buildTools/src/test/kotlin/tests/GradleBuildToolTest.kt renamed to scip-java/src/test/kotlin/tests/GradleBuildToolTest.kt

File renamed without changes.

tests/buildTools/src/test/kotlin/tests/MavenBuildToolTest.kt renamed to scip-java/src/test/kotlin/tests/MavenBuildToolTest.kt

File renamed without changes.

tests/buildTools/src/test/kotlin/tests/MissingBuildToolTest.kt renamed to scip-java/src/test/kotlin/tests/MissingBuildToolTest.kt

File renamed without changes.

tests/buildTools/src/test/kotlin/tests/ScipBuildToolTest.kt renamed to scip-java/src/test/kotlin/tests/ScipBuildToolTest.kt

File renamed without changes.

tests/buildTools/src/test/resources/fixtures/gradle/annotation-path/build.gradle renamed to scip-java/src/test/resources/fixtures/gradle/annotation-path/build.gradle

File renamed without changes.

0 commit comments

Comments
 (0)