Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[upstream_utils] Add googletest #6820

Merged
merged 10 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/upstream-utils.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@ jobs:
run: |
cd upstream_utils
./update_gcem.py
- name: Run update_googletest.py
pjreiniger marked this conversation as resolved.
Show resolved Hide resolved
run: |
cd upstream_utils
./update_googletest.py
- name: Run update_json.py
run: |
cd upstream_utils
Expand Down
1 change: 1 addition & 0 deletions .styleguide
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ modifiableFileExclude {
cmake/toolchains/
\.patch$
gradlew
third_party/
pjreiniger marked this conversation as resolved.
Show resolved Hide resolved
}

generatedFileExclude {
Expand Down
2 changes: 1 addition & 1 deletion crossConnIntegrationTests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ model {
components {
crossConnIntegrationTests(NativeExecutableSpec) {
targetBuildTypes 'debug'
nativeUtils.useRequiredLibrary(it, 'googletest_static')
binaries.all { binary ->
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
if (binary.buildType.name == 'debug') {
Expand All @@ -88,6 +87,7 @@ model {
project(':hal').addHalJniDependency(binary)
lib project: ':wpinet', library: 'wpinet', linkage: 'shared'
lib project: ':wpiutil', library: 'wpiutil', linkage: 'shared'
lib project: ':third_party:googletest', library: 'googletest', linkage: 'static'
if (binary.targetPlatform.name == nativeUtils.wpi.platforms.roborio) {
nativeUtils.useRequiredLibrary(binary, 'ni_link_libraries', 'ni_runtime_libraries')
}
Expand Down
1 change: 1 addition & 0 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ include 'msvcruntime'
include 'ntcoreffi'
include 'apriltag'
include 'processstarter'
include 'third_party:googletest'

buildCache {
def cred = {
Expand Down
1 change: 0 additions & 1 deletion shared/config.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ nativeUtils {
googleTestYear = "frc2024"
niLibVersion = "2024.2.1"
opencvVersion = "4.8.0-4"
googleTestVersion = "1.14.0-1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion shared/googletest.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
model {
binaries {
withType(GoogleTestTestSuiteBinarySpec).all {
nativeUtils.useRequiredLibrary(it, 'googletest_static')
lib project: ':third_party:googletest', library: 'googletest', linkage: 'static'
}
}
}
3 changes: 2 additions & 1 deletion sysid/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ model {
it.linker.args << '-lGL'
}
}
nativeUtils.useRequiredLibrary(it, "googletest_static")

lib project: ':third_party:googletest', library: 'googletest', linkage: 'static'
it.cppCompiler.define("RUNNING_SYSID_TESTS")
}
}
Expand Down
28 changes: 28 additions & 0 deletions third_party/googletest/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@


apply plugin: 'cpp'
apply plugin: 'visual-studio'
apply plugin: 'edu.wpi.first.NativeUtils'

ext {
nativeName = 'googletest'
}

apply from: "${rootDir}/shared/config.gradle"


model {
components {
"${nativeName}"(NativeLibrarySpec) {
sources.cpp {
source {
srcDirs "src/googlemock/src", "src/googletest/src"
include '*.cpp'
}
exportedHeaders {
srcDirs 'include', 'src/googletest', 'src/googlemock'
}
}
}
}
}
Loading
Loading