Skip to content

Commit

Permalink
Add CI test for the templatefora-checker (#1048)
Browse files Browse the repository at this point in the history
Co-authored-by: Werner Dietl <wdietl@gmail.com>
  • Loading branch information
Ao-senXiong and wmdietl authored Jan 6, 2025
1 parent f97a80e commit f70c3f9
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
4 changes: 4 additions & 0 deletions checker/bin-devel/test-misc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
37 changes: 37 additions & 0 deletions checker/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit f70c3f9

Please sign in to comment.