blob: 6c6be48f7ae6cd4448a9d0da257ff40c62834061 [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
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
47 binaries {
48 all {
49 if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
50 it.buildable = false
51 return
52 }
53
54 lib project: ":simulation:halsim_ws_core", library: "halsim_ws_core", linkage: "static"
55 }
56
57 withType(GoogleTestTestSuiteBinarySpec) {
58 project(':hal').addHalDependency(it, 'shared')
59 lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
60 lib library: pluginName, linkage: 'shared'
61 if (it.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
62 nativeUtils.useRequiredLibrary(it, 'netcomm_shared', 'chipobject_shared', 'visa_shared', 'ni_runtime_shared')
63 }
64 }
65 }
66
67}
68
69tasks.withType(RunTestExecutable) {
70 args "--gtest_output=xml:test_detail.xml"
71 outputs.dir outputDir
72}