-
Notifications
You must be signed in to change notification settings - Fork 694
[upstream_utils] Add googletest #6820
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
Merged
Merged
Changes from 6 commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
651ddf7
[upstream utils] Add gtest
pjreiniger e98a146
Move package per code review
pjreiniger 5509c11
Whoops
pjreiniger 5a530e0
Update cmake, publish gradle
pjreiniger 81b46b8
Merge remote-tracking branch 'origin/main' into upstream_gtest
pjreiniger a51a423
FIx publishing
pjreiniger d85c8bd
Merge remote-tracking branch 'origin/main' into upstream_gtest
pjreiniger f6f097f
Update to new upstream utils format
pjreiniger 6468163
Code review
pjreiniger c7ad632
Fix step name
pjreiniger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ cppSrcFileInclude { | |
|
|
||
| modifiableFileExclude { | ||
| cmake/toolchains/ | ||
| thirdparty/ | ||
| \.patch$ | ||
| gradlew | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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: ':thirdparty:googletest', library: 'googletest', linkage: 'static' | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| project(googletest) | ||
|
|
||
| include(CompileWarnings) | ||
|
|
||
| file( | ||
| GLOB_RECURSE googletest_src | ||
| src/googlemock/src/*.cpp | ||
| src/googletest/src/*.cpp | ||
| ) | ||
|
|
||
| add_library(googletest ${googletest_src}) | ||
| set_target_properties(googletest PROPERTIES DEBUG_POSTFIX "d") | ||
|
|
||
| set_property(TARGET googletest PROPERTY FOLDER "libraries") | ||
| target_compile_features(googletest PUBLIC cxx_std_20) | ||
|
|
||
| include_directories( | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/include" | ||
| "${CMAKE_CURRENT_SOURCE_DIR}/src/googletest" | ||
| ) | ||
|
|
||
| target_include_directories( | ||
| googletest | ||
| PUBLIC | ||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
| ) | ||
| set_target_properties(googletest | ||
| PROPERTIES | ||
| COMPILE_DEFINITIONS "GTEST_CREATE_SHARED_LIBRARY=1") | ||
| wpilib_target_warnings(googletest) | ||
|
|
||
| install(TARGETS googletest EXPORT googletest) | ||
| export(TARGETS googletest FILE googletest.cmake NAMESPACE googletest::) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,30 @@ | ||
|
|
||
|
|
||
| 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' | ||
| } | ||
| } | ||
| } | ||
| } | ||
| } | ||
|
|
||
| apply from: 'publish.gradle' |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.