Skip to content

Commit

Permalink
#45: Fixed run all tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aul12 committed Jan 1, 2023
1 parent b1a0763 commit 9856449
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 0 additions & 1 deletion Tests/LowLevel/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ target_link_libraries(MessageEncoding.mock PUBLIC ToolboxPlaneMessageDefs)
target_link_libraries(MessageDecoding.mock PUBLIC ToolboxPlaneMessageDefs)
target_link_libraries(protobuf.mock PUBLIC ToolboxPlaneMessageDefs)

#add_custom_target(RunAllTests DEPENDS ${AllTests})
#
#add_custom_target(coverage.info
# COMMAND lcov --capture --directory ${CMAKE_CURRENT_BINARY_DIR} --output-file ${CMAKE_CURRENT_BINARY_DIR}/coverage.info
Expand Down
7 changes: 3 additions & 4 deletions Tests/LowLevel/Mock/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ endfunction()



set(AllTestResults)
add_custom_target(RunAllTests)

# Function to build a mock test for a module
function(make_test)
Expand Down Expand Up @@ -79,12 +79,11 @@ function(make_test)
endforeach ()

# Create a target to run the test to be used as a dependency
add_custom_command(
OUTPUT ${test_name}.xml
add_custom_target(${test_name}.run
COMMAND ${TestExecutable} --gtest_repeat=10 --gtest_shuffle --gtest_output=xml:${test_name}.xml
DEPENDS ${TestExecutable})

# Add test to list of tests
set(AllTestResults ${AllTestResults} ${test_name}.xml PARENT_SCOPE)
add_dependencies(RunAllTests ${test_name}.run)
endfunction()

0 comments on commit 9856449

Please sign in to comment.