blob: fbdee04de4b4f649c0d54a8e4cb721028d3043ce [file] [log] [blame]
Austin Schuh1e69f942020-11-14 15:06:14 -08001
2description = "WebSocket Server Extension"
3
4ext {
5 includeWpiutil = true
6 pluginName = 'halsim_ws_server'
7}
8
9apply plugin: 'google-test-test-suite'
10
11
12ext {
13 staticGtestConfigs = [:]
14}
15
16staticGtestConfigs["${pluginName}Test"] = []
17apply from: "${rootDir}/shared/googletest.gradle"
18
19apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
20
21model {
22 testSuites {
23 def comps = $.components
James Kuszmaulcf324122023-01-14 14:07:17 -080024 if (!project.hasProperty('onlylinuxathena')) {
Austin Schuh1e69f942020-11-14 15:06:14 -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
47 binaries {
48 all {
49 if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
50 it.buildable = false
51 return
52 }
53
James Kuszmaulcf324122023-01-14 14:07:17 -080054 lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
Austin Schuh1e69f942020-11-14 15:06:14 -080055 lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
56 }
57
58 withType(GoogleTestTestSuiteBinarySpec) {
59 project(':hal').addHalDependency(it, 'shared')
60 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
61 lib library: pluginName, linkage: 'shared'
62 if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
Austin Schuh812d0d12021-11-04 20:16:48 -070063 nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
Austin Schuh1e69f942020-11-14 15:06:14 -080064 }
65 }
66 }
Austin Schuh1e69f942020-11-14 15:06:14 -080067}
68
69tasks.withType(RunTestExecutable) {
70 args "--gtest_output=xml:test_detail.xml"
71 outputs.dir outputDir
72}