James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 1 | if (project.hasProperty('onlylinuxathena')) { |
| 2 | return; |
| 3 | } |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 4 | |
| 5 | description = "WebSocket Server Extension" |
| 6 | |
| 7 | ext { |
| 8 | includeWpiutil = true |
| 9 | pluginName = 'halsim_ws_server' |
| 10 | } |
| 11 | |
| 12 | apply plugin: 'google-test-test-suite' |
| 13 | |
| 14 | |
| 15 | ext { |
| 16 | staticGtestConfigs = [:] |
| 17 | } |
| 18 | |
| 19 | staticGtestConfigs["${pluginName}Test"] = [] |
| 20 | apply from: "${rootDir}/shared/googletest.gradle" |
| 21 | |
| 22 | apply from: "${rootDir}/shared/plugins/setupBuild.gradle" |
| 23 | |
| 24 | model { |
| 25 | testSuites { |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 26 | "${pluginName}Test"(GoogleTestTestSuiteSpec) { |
| 27 | for(NativeComponentSpec c : $.components) { |
| 28 | if (c.name == pluginName) { |
| 29 | testing c |
| 30 | break |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 31 | } |
James Kuszmaul | b13e13f | 2023-11-22 20:44:04 -0800 | [diff] [blame] | 32 | } |
| 33 | sources.cpp { |
| 34 | source { |
| 35 | srcDirs 'src/test/native/cpp' |
| 36 | include '**/*.cpp' |
| 37 | } |
| 38 | exportedHeaders { |
| 39 | srcDirs 'src/test/native/include', 'src/main/native/cpp' |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | |
| 45 | binaries { |
| 46 | all { |
| 47 | if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
| 48 | it.buildable = false |
| 49 | return |
| 50 | } |
| 51 | |
James Kuszmaul | cf32412 | 2023-01-14 14:07:17 -0800 | [diff] [blame] | 52 | lib project: ':wpinet', library: 'wpinet', linkage: 'shared' |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 53 | lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static" |
| 54 | } |
| 55 | |
| 56 | withType(GoogleTestTestSuiteBinarySpec) { |
| 57 | project(':hal').addHalDependency(it, 'shared') |
| 58 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
| 59 | lib library: pluginName, linkage: 'shared' |
| 60 | if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
Austin Schuh | 812d0d1 | 2021-11-04 20:16:48 -0700 | [diff] [blame] | 61 | nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries') |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 62 | } |
| 63 | } |
| 64 | } |
Austin Schuh | 1e69f94 | 2020-11-14 15:06:14 -0800 | [diff] [blame] | 65 | } |
| 66 | |
| 67 | tasks.withType(RunTestExecutable) { |
| 68 | args "--gtest_output=xml:test_detail.xml" |
| 69 | outputs.dir outputDir |
| 70 | } |