mirror of
https://github.com/nasa/fprime.git
synced 2025-12-10 00:44:37 -06:00
Use GoogleTest as a submodule (#2371)
* Add googletest submodule * Refactor googletest usage * Update submodule usage in workflwos * Spelling * Update missed workflows * Use checkout@v4
This commit is contained in:
parent
dc3cb605d2
commit
b9551a2f52
1
.github/actions/spelling/expect.txt
vendored
1
.github/actions/spelling/expect.txt
vendored
@ -390,6 +390,7 @@ gettime
|
||||
gettimeofday
|
||||
getty
|
||||
ghprb
|
||||
gitmodules
|
||||
gmock
|
||||
Gnc
|
||||
Gnd
|
||||
|
||||
3
.github/workflows/autodocs.yml
vendored
3
.github/workflows/autodocs.yml
vendored
@ -10,9 +10,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: Setup Dependencies
|
||||
run: |
|
||||
|
||||
9
.github/workflows/build-test-macos.yml
vendored
9
.github/workflows/build-test-macos.yml
vendored
@ -21,9 +21,10 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: F prime CI step
|
||||
run: ./ci/tests/Framework.bash
|
||||
@ -40,9 +41,10 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: F prime CI step
|
||||
run: ./ci/tests/Ref.bash
|
||||
@ -59,9 +61,10 @@ jobs:
|
||||
runs-on: macos-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: Install coreutils
|
||||
run: brew install coreutils
|
||||
|
||||
3
.github/workflows/build-test-rpi.yml
vendored
3
.github/workflows/build-test-rpi.yml
vendored
@ -23,9 +23,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: Setup RPI Toolchain
|
||||
uses: fprime-community/setup-rpi-sysroot@main
|
||||
|
||||
15
.github/workflows/build-test.yml
vendored
15
.github/workflows/build-test.yml
vendored
@ -21,9 +21,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: F prime CI step
|
||||
run: ./ci/tests/Framework.bash
|
||||
@ -40,9 +41,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: F prime CI step
|
||||
run: ./ci/tests/Ref.bash
|
||||
@ -59,9 +61,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: Setup Valgrind
|
||||
run: |
|
||||
@ -82,9 +85,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: Setup Dependencies
|
||||
run: |
|
||||
@ -104,9 +108,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
- name: CMake Tests
|
||||
working-directory: ./cmake/test
|
||||
|
||||
3
.github/workflows/cppcheck-scan.yml
vendored
3
.github/workflows/cppcheck-scan.yml
vendored
@ -24,9 +24,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
|
||||
- name: Install cppcheck
|
||||
|
||||
3
.github/workflows/cpplint-scan.yml
vendored
3
.github/workflows/cpplint-scan.yml
vendored
@ -23,9 +23,10 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- uses: ./.github/actions/setup
|
||||
|
||||
- name: Install cpplint
|
||||
|
||||
@ -30,15 +30,15 @@ jobs:
|
||||
needs: get-branch
|
||||
steps:
|
||||
- name: "Checkout target repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: false
|
||||
repository: fprime-community/fprime-workshop-led-blinker
|
||||
ref: ${{ needs.get-branch.outputs.target-branch }}
|
||||
- name: "Overlay current F´ revision"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: true
|
||||
path: ./fprime
|
||||
fetch-depth: 0
|
||||
- uses: ./fprime/.github/actions/setup
|
||||
|
||||
3
.github/workflows/fpp-tests.yml
vendored
3
.github/workflows/fpp-tests.yml
vendored
@ -17,9 +17,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Checkout F´ Repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
submodules: true
|
||||
- name: "Install requirements.txt"
|
||||
run: |
|
||||
pip3 install -r ./requirements.txt
|
||||
|
||||
16
.github/workflows/reusable-project-builder.yml
vendored
16
.github/workflows/reusable-project-builder.yml
vendored
@ -47,15 +47,15 @@ jobs:
|
||||
name: "Build"
|
||||
steps:
|
||||
- name: "Checkout target repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: false
|
||||
repository: ${{ inputs.target_repository }}
|
||||
ref: ${{ inputs.target_ref }}
|
||||
- name: "Overlay current F´ revision"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: true
|
||||
path: ${{ inputs.fprime_location }}
|
||||
- name: "Install requirements.txt"
|
||||
run: |
|
||||
@ -78,15 +78,15 @@ jobs:
|
||||
name: "Unit Tests"
|
||||
steps:
|
||||
- name: "Checkout target repository"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: false
|
||||
repository: ${{ inputs.target_repository }}
|
||||
ref: ${{ inputs.target_ref }}
|
||||
- name: "Overlay current F´ revision"
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
submodules: true
|
||||
path: ${{ inputs.fprime_location }}
|
||||
- name: "Install requirements.txt"
|
||||
run: |
|
||||
|
||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
[submodule "googletest"]
|
||||
path = googletest
|
||||
url = https://github.com/google/googletest.git
|
||||
@ -27,7 +27,7 @@ if (BUILD_TESTING)
|
||||
"${CMAKE_CURRENT_LIST_DIR}/test/ut/SocketTestHelper.cpp")
|
||||
target_include_directories(PortSelector PUBLIC
|
||||
"${FPRIME_FRAMEWORK_PATH}/STest"
|
||||
"${FPRIME_FRAMEWORK_PATH}/gtest/googletest-src/googletest/include"
|
||||
"${FPRIME_FRAMEWORK_PATH}/googletest/googletest/include"
|
||||
)
|
||||
add_dependencies(PortSelector STest Fw_Buffer)
|
||||
target_link_libraries(PortSelector STest Fw_Buffer)
|
||||
|
||||
@ -160,7 +160,7 @@ function(fprime_setup_included_code)
|
||||
setup_global_targets()
|
||||
# For BUILD_TESTING builds then set up libraries that support testing
|
||||
if (BUILD_TESTING AND NOT DEFINED FPRIME_SUB_BUILD_TARGETS)
|
||||
include("${FPRIME_FRAMEWORK_PATH}/cmake/googletest-download/googletest.cmake")
|
||||
add_subdirectory("${FPRIME_FRAMEWORK_PATH}/googletest/" "${CMAKE_BINARY_DIR}/F-Prime/googletest")
|
||||
endif()
|
||||
if (BUILD_TESTING)
|
||||
add_subdirectory("${FPRIME_FRAMEWORK_PATH}/STest/" "${CMAKE_BINARY_DIR}/F-Prime/STest")
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
|
||||
project(googletest-download NONE)
|
||||
|
||||
include(ExternalProject)
|
||||
ExternalProject_Add(googletest
|
||||
GIT_REPOSITORY https://github.com/google/googletest.git
|
||||
GIT_TAG a3460d1
|
||||
SOURCE_DIR "${FPRIME_FRAMEWORK_PATH}/gtest/googletest-src"
|
||||
BINARY_DIR "${FPRIME_FRAMEWORK_PATH}/gtest/googletest-build-${TOOLCHAIN_NAME}"
|
||||
CONFIGURE_COMMAND ""
|
||||
BUILD_COMMAND ""
|
||||
INSTALL_COMMAND ""
|
||||
TEST_COMMAND ""
|
||||
)
|
||||
@ -1,33 +0,0 @@
|
||||
# Download and unpack googletest at configure time if it doesn't exit already
|
||||
if (NOT IS_DIRECTORY "${FPRIME_FRAMEWORK_PATH}/gtest/googletest-build-${TOOLCHAIN_NAME}/googletest")
|
||||
configure_file("${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt.in" googletest-download/CMakeLists.txt)
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" .
|
||||
RESULT_VARIABLE result
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
|
||||
if(result)
|
||||
message(FATAL_ERROR "CMake step for googletest failed: ${result}")
|
||||
endif()
|
||||
execute_process(COMMAND ${CMAKE_COMMAND} --build .
|
||||
RESULT_VARIABLE result
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download )
|
||||
if(result)
|
||||
message(FATAL_ERROR "Build step for googletest failed: ${result}")
|
||||
endif()
|
||||
endif()
|
||||
# Prevent overriding the parent project's compiler/linker
|
||||
# settings on Windows
|
||||
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)
|
||||
|
||||
# Add googletest directly to our build. This defines
|
||||
# the gtest and gtest_main targets.
|
||||
add_subdirectory(${FPRIME_FRAMEWORK_PATH}/gtest/googletest-src
|
||||
${FPRIME_FRAMEWORK_PATH}/gtest/googletest-build-${TOOLCHAIN_NAME}
|
||||
EXCLUDE_FROM_ALL)
|
||||
|
||||
# The gtest/gtest_main targets carry header search path
|
||||
# dependencies automatically when using CMake 2.8.11 or
|
||||
# later. Otherwise we have to add them here ourselves.
|
||||
if (CMAKE_VERSION VERSION_LESS 2.8.11)
|
||||
include_directories("${gtest_SOURCE_DIR}/include")
|
||||
endif()
|
||||
|
||||
1
googletest
Submodule
1
googletest
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 58d77fa8070e8cec2dc1ed015d66b454c8d78850
|
||||
Loading…
x
Reference in New Issue
Block a user