Brian Silverman | 8fce748 | 2020-01-05 13:18:21 -0800 | [diff] [blame] | 1 | description = "A plugin that listens on a socket so that you can use the real Driver Station software to connect to the simulation" |
| 2 | |
| 3 | ext { |
| 4 | includeWpiutil = true |
| 5 | pluginName = 'halsim_ds_socket' |
| 6 | } |
| 7 | |
| 8 | apply plugin: 'google-test-test-suite' |
| 9 | |
| 10 | |
| 11 | ext { |
| 12 | staticGtestConfigs = [:] |
| 13 | } |
| 14 | |
| 15 | staticGtestConfigs["${pluginName}Test"] = [] |
| 16 | apply from: "${rootDir}/shared/googletest.gradle" |
| 17 | |
| 18 | apply from: "${rootDir}/shared/plugins/setupBuild.gradle" |
| 19 | |
| 20 | |
| 21 | model { |
| 22 | testSuites { |
| 23 | def comps = $.components |
| 24 | if (!project.hasProperty('onlylinuxathena') && !project.hasProperty('onlylinuxraspbian') && !project.hasProperty('onlylinuxaarch64bionic')) { |
| 25 | "${pluginName}Test"(GoogleTestTestSuiteSpec) { |
| 26 | for(NativeComponentSpec c : comps) { |
| 27 | if (c.name == pluginName) { |
| 28 | testing c |
| 29 | break |
| 30 | } |
| 31 | } |
| 32 | sources { |
| 33 | 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' |
| 40 | } |
| 41 | } |
| 42 | } |
| 43 | } |
| 44 | } |
| 45 | } |
| 46 | binaries { |
| 47 | withType(GoogleTestTestSuiteBinarySpec) { |
| 48 | project(':hal').addHalDependency(it, 'shared') |
| 49 | lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared' |
| 50 | lib library: pluginName, linkage: 'shared' |
| 51 | if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) { |
| 52 | nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared') |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | tasks.withType(RunTestExecutable) { |
| 59 | args "--gtest_output=xml:test_detail.xml" |
| 60 | outputs.dir outputDir |
| 61 | } |