[build] Add combined test meta-task (#5813)

This commit is contained in:
Ryan Blue
2023-10-24 02:35:44 -04:00
committed by GitHub
parent 63ef585d4b
commit 928e87b4f4
4 changed files with 26 additions and 6 deletions

View File

@@ -88,9 +88,24 @@ If opening from a fresh clone, generated java dependencies will not exist. Most
`./gradlew build` builds _everything_, which includes debug and release builds for desktop and all installed cross compilers. Many developers don't need or want to build all of this. Therefore, common tasks have shortcuts to only build necessary components for common development and testing tasks. `./gradlew build` builds _everything_, which includes debug and release builds for desktop and all installed cross compilers. Many developers don't need or want to build all of this. Therefore, common tasks have shortcuts to only build necessary components for common development and testing tasks.
`./gradlew testDesktopCpp` and `./gradlew testDesktopJava` will build and run the tests for `wpilibc` and `wpilibj` respectively. They will only build the minimum components required to run the tests. `./gradlew testDesktopCpp` and `./gradlew testDesktopJava` will build and run the tests for `wpilibc` and `wpilibj` respectively. They will only build the minimum components required to run the tests. `./gradlew testDesktop` will run both `testDesktopJava` and `testDesktopCpp`.
`testDesktopCpp` and `testDesktopJava` tasks also exist for the projects `wpiutil`, `ntcore`, `cscore`, `hal` `wpilibNewCommands` and `cameraserver`. These can be ran with `./gradlew :projectName:task`. `testDesktopCpp`, `testDesktopJava`, and `testDesktop` tasks also exist for the following projects:
- `apriltag`
- `cameraserver`
- `cscore`
- `hal`
- `ntcore`
- `wpilibNewCommands`
- `wpimath`
- `wpinet`
- `wpiunits`
- `wpiutil`
- `romiVendordep`
- `xrpVendordep`
These can be ran with `./gradlew :projectName:task`.
`./gradlew buildDesktopCpp` and `./gradlew buildDesktopJava` will compile `wpilibcExamples` and `wpilibjExamples` respectively. The results can't be ran, but they can compile. `./gradlew buildDesktopCpp` and `./gradlew buildDesktopJava` will compile `wpilibcExamples` and `wpilibjExamples` respectively. The results can't be ran, but they can compile.

View File

@@ -0,0 +1,7 @@
apply from: "${rootDir}/shared/cppDesktopTestTask.gradle"
apply from: "${rootDir}/shared/javaDesktopTestTask.gradle"
tasks.register('testDesktop') {
dependsOn testDesktopJava
dependsOn testDesktopCpp
}

View File

@@ -182,8 +182,7 @@ model {
} }
} }
apply from: "${rootDir}/shared/cppDesktopTestTask.gradle" apply from: "${rootDir}/shared/cppJavaDesktopTestTask.gradle"
apply from: "${rootDir}/shared/javaDesktopTestTask.gradle"
tasks.withType(RunTestExecutable) { tasks.withType(RunTestExecutable) {
args "--gtest_output=xml:test_detail.xml" args "--gtest_output=xml:test_detail.xml"

View File

@@ -327,8 +327,7 @@ model {
} }
} }
apply from: "${rootDir}/shared/cppDesktopTestTask.gradle" apply from: "${rootDir}/shared/cppJavaDesktopTestTask.gradle"
apply from: "${rootDir}/shared/javaDesktopTestTask.gradle"
ext.getJniSpecClass = { ext.getJniSpecClass = {
return JniNativeLibrarySpec return JniNativeLibrarySpec