blob: 8db195162e0d39a7f52176772194ed2ba2251f31 [file] [log] [blame]
James Kuszmaulb13e13f2023-11-22 20:44:04 -08001if (project.hasProperty('onlylinuxathena')) {
2 return;
3}
Austin Schuh1e69f942020-11-14 15:06:14 -08004
5description = "WebSocket Server Extension"
6
7ext {
8 includeWpiutil = true
9 pluginName = 'halsim_ws_server'
10}
11
12apply plugin: 'google-test-test-suite'
13
14
15ext {
16 staticGtestConfigs = [:]
17}
18
19staticGtestConfigs["${pluginName}Test"] = []
20apply from: "${rootDir}/shared/googletest.gradle"
21
22apply from: "${rootDir}/shared/plugins/setupBuild.gradle"
23
24model {
25 testSuites {
James Kuszmaulb13e13f2023-11-22 20:44:04 -080026 "${pluginName}Test"(GoogleTestTestSuiteSpec) {
27 for(NativeComponentSpec c : $.components) {
28 if (c.name == pluginName) {
29 testing c
30 break
Austin Schuh1e69f942020-11-14 15:06:14 -080031 }
James Kuszmaulb13e13f2023-11-22 20:44:04 -080032 }
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 Schuh1e69f942020-11-14 15:06:14 -080040 }
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 Kuszmaulcf324122023-01-14 14:07:17 -080052 lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
Austin Schuh1e69f942020-11-14 15:06:14 -080053 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 Schuh812d0d12021-11-04 20:16:48 -070061 nativeUtils.useRequiredLibrary(it, 'ni_link_libraries', 'ni_runtime_libraries')
Austin Schuh1e69f942020-11-14 15:06:14 -080062 }
63 }
64 }
Austin Schuh1e69f942020-11-14 15:06:14 -080065}
66
67tasks.withType(RunTestExecutable) {
68 args "--gtest_output=xml:test_detail.xml"
69 outputs.dir outputDir
70}