mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
Putting an early exit if statement at the top instead of wrapping the whole file contents unbreaks unit test configs, as was discovered for SysId. It reduces nesting as well. Unused plugins were removed from the beginnings of files as well.
71 lines
1.9 KiB
Groovy
71 lines
1.9 KiB
Groovy
if (project.hasProperty('onlylinuxathena')) {
|
|
return;
|
|
}
|
|
|
|
description = "WebSocket Server Extension"
|
|
|
|
ext {
|
|
includeWpiutil = true
|
|
pluginName = 'halsim_ws_server'
|
|
}
|
|
|
|
apply plugin: 'google-test-test-suite'
|
|
|
|
|
|
ext {
|
|
staticGtestConfigs = [:]
|
|
}
|
|
|
|
staticGtestConfigs["${pluginName}Test"] = []
|
|
apply from: "${rootDir}/shared/googletest.gradle"
|
|
|
|
apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
|
|
|
|
model {
|
|
testSuites {
|
|
"${pluginName}Test"(GoogleTestTestSuiteSpec) {
|
|
for(NativeComponentSpec c : $.components) {
|
|
if (c.name == pluginName) {
|
|
testing c
|
|
break
|
|
}
|
|
}
|
|
sources.cpp {
|
|
source {
|
|
srcDirs 'src/test/native/cpp'
|
|
include '**/*.cpp'
|
|
}
|
|
exportedHeaders {
|
|
srcDirs 'src/test/native/include', 'src/main/native/cpp'
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
binaries {
|
|
all {
|
|
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
|
it.buildable = false
|
|
return
|
|
}
|
|
|
|
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
|
|
lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
|
|
}
|
|
|
|
withType(GoogleTestTestSuiteBinarySpec) {
|
|
project(':hal').addHalDependency(it, 'shared')
|
|
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
|
|
lib library: pluginName, linkage: 'shared'
|
|
if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
|
|
nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
tasks.withType(RunTestExecutable) {
|
|
args "--gtest_output=xml:test_detail.xml"
|
|
outputs.dir outputDir
|
|
}
|