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

Fix focal builds: use python3 with check_test_ran.py (#3155) #3278

Merged
merged 1 commit into from
Jan 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion cmake/GazeboTestUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ macro (gz_build_tests)

# Check that the test produced a result and create a failure if it didn't.
# Guards against crashed and timed out tests.
add_test(check_${BINARY_NAME} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
add_test(check_${BINARY_NAME} ${PYTHON_EXECUTABLE} ${PROJECT_SOURCE_DIR}/tools/check_test_ran.py
${CMAKE_BINARY_DIR}/test_results/${BINARY_NAME}.xml)

if(GAZEBO_RUN_VALGRIND_TESTS AND VALGRIND_PROGRAM)
Expand Down
14 changes: 14 additions & 0 deletions cmake/SearchForStuff.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,20 @@ else()
set(HAVE_SPNAV FALSE)
endif()

########################################
# Find python3, which is used by tools/check_test_ran.py
if (${CMAKE_VERSION} VERSION_LESS 3.12)
find_package(PythonInterp 3)
else()
find_package(Python3 COMPONENTS Interpreter)
if (Python3_FOUND)
set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
endif()
endif()
if (NOT EXISTS ${PYTHON_EXECUTABLE})
BUILD_WARNING("python3 not found. The check_test_ran.py script will cause tests to fail.")
endif()

########################################
# Find xsltproc, which is used by tools/check_test_ran.py
find_program(XSLTPROC xsltproc)
Expand Down