Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,16 @@ on:
permissions:
contents: write
jobs:
test:
name: Test
runs-on: ubuntu-latest
container: wpilib/roborio-cross-ubuntu:2025-24.04
steps:
- uses: actions/checkout@v4
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Compile and run tests on robot code
run: ./gradlew test
linting:
name: Linting
runs-on: ubuntu-latest
Expand Down
47 changes: 47 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ repositories {

dependencies {
implementation "com.squareup:javapoet:1.13.0"

testImplementation 'junit:junit:4.13.2'
testImplementation 'com.google.testing.compile:compile-testing:0.21.0'
testImplementation 'com.google.truth:truth:1.4.4'
}

test {
useJUnit()
}

publishing {
Expand All @@ -27,3 +35,42 @@ publishing {
}
}
}

import org.gradle.api.tasks.testing.logging.TestExceptionFormat
import org.gradle.api.tasks.testing.logging.TestLogEvent

tasks.withType(Test) {
testLogging {
// set options for log level LIFECYCLE
events TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
showExceptions true
showCauses true
showStackTraces true

// set options for log level DEBUG and INFO
debug {
events TestLogEvent.STARTED,
TestLogEvent.FAILED,
TestLogEvent.PASSED,
TestLogEvent.SKIPPED,
TestLogEvent.STANDARD_ERROR,
TestLogEvent.STANDARD_OUT
exceptionFormat TestExceptionFormat.FULL
}
info.events = debug.events
info.exceptionFormat = debug.exceptionFormat

afterSuite { desc, result ->
if (!desc.parent) { // will match the outermost suite
def output = "Results: ${result.resultType} (${result.testCount} tests, ${result.successfulTestCount} passed, ${result.failedTestCount} failed, ${result.skippedTestCount} skipped)"
def startItem = '| ', endItem = ' |'
def repeatLength = startItem.length() + output.length() + endItem.length()
println('\n' + ('-' * repeatLength) + '\n' + startItem + output + endItem + '\n' + ('-' * repeatLength))
}
}
}
}
28 changes: 28 additions & 0 deletions src/main/java/org/frc5572/robotools/AnnotationGenerator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package org.frc5572.robotools;

import javax.annotation.processing.ProcessingEnvironment;
import javax.annotation.processing.RoundEnvironment;
import javax.lang.model.element.TypeElement;

/**
* A specific annotation that generates java classes.
*/
public interface AnnotationGenerator {

/**
* Provide the generator the processing environment.
*/
public void init(ProcessingEnvironment env);

/**
* @return the full canonical name of the annotation type this generator handles e.g.
* "frc.robot.util.GenerateEmptyIO"
*/
public String getAnnotationQualifiedName();

/**
* Called from the processor for each annotation type on each round.
*/
public void generate(TypeElement annotation, RoundEnvironment roundEnv);

}
27 changes: 0 additions & 27 deletions src/main/java/org/frc5572/robotools/AnnotationMirrorVisitor.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/java/org/frc5572/robotools/BoolVisitor.java

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/java/org/frc5572/robotools/ClassListVisitor.java

This file was deleted.

14 changes: 0 additions & 14 deletions src/main/java/org/frc5572/robotools/ClassVisitor.java

This file was deleted.

Loading
Loading