diff --git a/checker/bin-devel/test-misc.sh b/checker/bin-devel/test-misc.sh index 3e21746d48e..f2227a156e2 100755 --- a/checker/bin-devel/test-misc.sh +++ b/checker/bin-devel/test-misc.sh @@ -16,6 +16,10 @@ PLUME_SCRIPTS="$SCRIPTDIR/.plume-scripts" "$GIT_SCRIPTS/git-clone-related" eisop checker-framework.demos ./gradlew :checker:demosTests --console=plain --warning-mode=all +## Checker Framework templatefora-checker +"$GIT_SCRIPTS/git-clone-related" eisop templatefora-checker +./gradlew :checker:templateTests --console=plain --warning-mode=all + status=0 ## Code style and formatting diff --git a/checker/build.gradle b/checker/build.gradle index bbc55daf3cd..caedf1412ce 100644 --- a/checker/build.gradle +++ b/checker/build.gradle @@ -355,6 +355,43 @@ task demosTests(dependsOn: assembleForJavac, group: 'Verification') { } } +task templateTests(dependsOn: assembleForJavac, group: 'Verification') { + description = 'Test that the templatefora-checker is working as expected.' + + def injected = project.objects.newInstance(InjectedExecOps) + + doLast { + File templateforCheckerDir = new File(projectDir, '../../templatefora-checker'); + if (!templateforCheckerDir.exists()) { + injected.execOps.exec { + workingDir file(templateforCheckerDir.toString() + '/../') + executable 'git' + args = [ + 'clone', + '--depth', + '1', + 'https://github.com/eisop/templatefora-checker.git' + ] + } + } else { + injected.execOps.exec { + workingDir templateforCheckerDir + executable 'git' + args = [ + 'pull', + 'https://github.com/eisop/templatefora-checker.git' + ] + ignoreExitValue = true + } + } + println "Running Gradle build in $templateforCheckerDir" + injected.execOps.exec { + workingDir = templateforCheckerDir + commandLine "./gradlew", "build" + } + } +} + task allNullnessTests(type: Test, group: 'Verification') { description = 'Run all JUnit tests for the Nullness Checker.' include '**/Nullness*.class'