From 00277ba283fb995c00f3b668bda38663960aa1a5 Mon Sep 17 00:00:00 2001 From: "David P. Baker" Date: Wed, 15 Nov 2023 13:05:02 -0500 Subject: [PATCH] Move conformance test framework code into a subproject (#108) Part of #107. --- build.gradle | 3 +-- conformance/build.gradle | 24 +++++++++++++++++++ .../conformance/AbstractConformanceTest.java | 0 .../conformance/ConformanceTestReport.java | 3 +-- settings.gradle | 1 + 5 files changed, 27 insertions(+), 4 deletions(-) create mode 100644 conformance/build.gradle rename {src/test => conformance/src/main}/java/tests/conformance/AbstractConformanceTest.java (100%) rename {src/test => conformance/src/main}/java/tests/conformance/ConformanceTestReport.java (98%) diff --git a/build.gradle b/build.gradle index a7dff57..498ebbe 100644 --- a/build.gradle +++ b/build.gradle @@ -42,11 +42,10 @@ dependencies { testImplementation 'junit:junit:4.12' // The jsr305 dep lets us use its annotations in some of the sample inputs we test against. testImplementation 'com.google.code.findbugs:jsr305:3.0.2' - // The Guava dep lets us test our special handling of some Guava classes. testImplementation 'com.google.guava:guava:31.1-jre' testImplementation 'org.plumelib:plume-util:1.5.5' testImplementation "org.checkerframework:framework-test:${cfVersion}" - testImplementation "com.google.truth:truth:1.1.3" + testImplementation project(":conformance") errorproneJavac "com.google.errorprone:javac:9+181-r4173-1" errorprone "com.google.errorprone:error_prone_core:2.18.0" diff --git a/conformance/build.gradle b/conformance/build.gradle new file mode 100644 index 0000000..661b217 --- /dev/null +++ b/conformance/build.gradle @@ -0,0 +1,24 @@ +plugins { + id 'java-library' +} + +group 'org.jspecify' +version '0.1' + +repositories { + mavenCentral() +} + +java { + sourceCompatibility = 1.9 +} + +dependencies { + api 'com.google.guava:guava:31.1-jre' + implementation "com.google.truth:truth:1.1.3" + implementation "org.jspecify:jspecify:0.0.0-SNAPSHOT" +} + +test { + useJUnitPlatform() +} diff --git a/src/test/java/tests/conformance/AbstractConformanceTest.java b/conformance/src/main/java/tests/conformance/AbstractConformanceTest.java similarity index 100% rename from src/test/java/tests/conformance/AbstractConformanceTest.java rename to conformance/src/main/java/tests/conformance/AbstractConformanceTest.java diff --git a/src/test/java/tests/conformance/ConformanceTestReport.java b/conformance/src/main/java/tests/conformance/ConformanceTestReport.java similarity index 98% rename from src/test/java/tests/conformance/ConformanceTestReport.java rename to conformance/src/main/java/tests/conformance/ConformanceTestReport.java index 98d749e..8eb0bb1 100644 --- a/src/test/java/tests/conformance/ConformanceTestReport.java +++ b/conformance/src/main/java/tests/conformance/ConformanceTestReport.java @@ -28,12 +28,11 @@ import java.nio.file.Path; import java.util.Collection; import java.util.Formatter; -import tests.ConformanceTest; import tests.conformance.AbstractConformanceTest.ExpectedFact; import tests.conformance.AbstractConformanceTest.Fact; import tests.conformance.AbstractConformanceTest.ReportedFact; -/** Represents the results of running {@link ConformanceTest} on a set of files. */ +/** Represents the results of running an {@link AbstractConformanceTest} on a set of files. */ public final class ConformanceTestReport { /** An empty report. */ static final ConformanceTestReport EMPTY = diff --git a/settings.gradle b/settings.gradle index ea4b735..a08c015 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,5 +1,6 @@ // Project name is read-only in build scripts, and defaults to directory name. rootProject.name = "jspecify-reference-checker" +include 'conformance' def initializeProject() { exec {