blob: 0e90938df6439598952a206b6dc0f261323cdfd1 [file] [log] [blame]
Brian Silverman8fce7482020-01-05 13:18:21 -08001description = "A plugin that listens on a socket so that you can use the real Driver Station software to connect to the simulation"
2
3ext {
4 includeWpiutil = true
5 pluginName = 'halsim_ds_socket'
6}
7
8apply plugin: 'google-test-test-suite'
9
10
11ext {
12 staticGtestConfigs = [:]
13}
14
15staticGtestConfigs["${pluginName}Test"] = []
16apply from: "${rootDir}/shared/googletest.gradle"
17
18apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
19
20
21model {
22 testSuites {
23 def comps = $.components
James Kuszmaulcf324122023-01-14 14:07:17 -080024 if (!project.hasProperty('onlylinuxathena')) {
Brian Silverman8fce7482020-01-05 13:18:21 -080025 "${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 {
James Kuszmaulcf324122023-01-14 14:07:17 -080047 all {
48 lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
49 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
50 }
Brian Silverman8fce7482020-01-05 13:18:21 -080051 withType(GoogleTestTestSuiteBinarySpec) {
52 project(':hal').addHalDependency(it, 'shared')
James Kuszmaulcf324122023-01-14 14:07:17 -080053 lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
Brian Silverman8fce7482020-01-05 13:18:21 -080054 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
55 lib library: pluginName, linkage: 'shared'
56 if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
Austin Schuh812d0d12021-11-04 20:16:48 -070057 nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
Brian Silverman8fce7482020-01-05 13:18:21 -080058 }
59 }
60 }
61}
62
63tasks.withType(RunTestExecutable) {
64 args "--gtest_output=xml:test_detail.xml"
65 outputs.dir outputDir
66}