Add support for running gtest
This commit is contained in:
parent
3f9359c031
commit
29ba09947c
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"enableCppIntellisense": true,
|
"enableCppIntellisense": true,
|
||||||
"currentLanguage": "cpp",
|
"currentLanguage": "cpp",
|
||||||
"projectYear": "2019",
|
"projectYear": "2020",
|
||||||
"teamNumber": 0
|
"teamNumber": 9999
|
||||||
}
|
}
|
||||||
|
30
build.gradle
30
build.gradle
@ -1,9 +1,10 @@
|
|||||||
plugins {
|
plugins {
|
||||||
id 'cpp'
|
id 'cpp'
|
||||||
id 'java'
|
id 'java'
|
||||||
|
id 'google-test'
|
||||||
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
|
id 'edu.wpi.first.wpilib.repositories.WPILibRepositoriesPlugin' version '2020.2'
|
||||||
id 'edu.wpi.first.NativeUtils' version '2020.7.4'
|
id 'edu.wpi.first.NativeUtils' version '2020.7.4'
|
||||||
id 'edu.wpi.first.GradleJni' version '0.10.1'
|
id 'edu.wpi.first.GradleJni' version '0.11.0'
|
||||||
id 'edu.wpi.first.GradleVsCode' version '0.12.0'
|
id 'edu.wpi.first.GradleVsCode' version '0.12.0'
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,6 +88,33 @@ model {
|
|||||||
nativeUtils.useRequiredLibrary(it, "driver_shared")
|
nativeUtils.useRequiredLibrary(it, "driver_shared")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
testSuites {
|
||||||
|
VendorTest {
|
||||||
|
sources.cpp {
|
||||||
|
source {
|
||||||
|
srcDir 'src/test/native/cpp'
|
||||||
|
include '**/*.cpp'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
binaries.all {
|
||||||
|
lib library: 'VendorDriver', linkage: 'shared'
|
||||||
|
}
|
||||||
|
|
||||||
|
nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared", "googletest_static")
|
||||||
|
}
|
||||||
|
|
||||||
|
VendorDriverTest {
|
||||||
|
sources.cpp {
|
||||||
|
source {
|
||||||
|
srcDir 'src/test/driver/cpp'
|
||||||
|
include '**/*.cpp'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
nativeUtils.useRequiredLibrary(it, "wpilib_executable_shared", "googletest_static")
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply from: 'publish.gradle'
|
apply from: 'publish.gradle'
|
||||||
|
6
src/test/driver/cpp/main.cpp
Normal file
6
src/test/driver/cpp/main.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
6
src/test/native/cpp/main.cpp
Normal file
6
src/test/native/cpp/main.cpp
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
#include "gtest/gtest.h"
|
||||||
|
|
||||||
|
int main(int argc, char** argv) {
|
||||||
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
return RUN_ALL_TESTS();
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user