Skip to content
Open
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
28 changes: 26 additions & 2 deletions test/integration/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,33 @@ endif()

find_program(XMLLINT_EXE xmllint)
if (EXISTS ${XMLLINT_EXE})
set (tests ${tests} schema_test.cc)
# get xmllint version
execute_process(
COMMAND ${XMLLINT_EXE} --version
ERROR_VARIABLE XMLLINT_VERSION_OUTPUT
)
# typical output: "/usr/bin/xmllint: using libxml version 20913\ncompiled with: ..."
# version is formatted as a single integer, with 20913 representing 2.9.13
string(REGEX MATCH "using libxml version [0-9]+" XMLLINT_VERSION_STRING "${XMLLINT_VERSION_OUTPUT}")
string(REPLACE "using libxml version " "" XMLLINT_VERSION "${XMLLINT_VERSION_STRING}")
if("${XMLLINT_VERSION}" STREQUAL "")
message(WARNING "Unable to identify xmllint version. schema_test won't be run")
elseif("${XMLLINT_VERSION}" LESS 10000)
message(WARNING "Old version of xmllint (${XMLLINT_VERSION_STRING}) detected. schema_test won't be run")
elseif("${XMLLINT_VERSION}" LESS 21500)
# schema test is broken with very new versions of xmllint
# https://github.com/gazebosim/sdformat/issues/1656
# enable schema test if xmllint is older than 2.15.0
set (tests ${tests} schema_test.cc)
else()
# TODO: convert to WARNING when https://github.com/gazebosim/sdformat/issues/1656
# is resolved on supported platforms. It currently fails on Ubuntu 26.04
message(STATUS "WARNING: xmllint version (${XMLLINT_VERSION}) is too new; "
"schema_test won't be run. "
"See https://github.com/gazebosim/sdformat/issues/1656")
endif()
else()
gz_build_warning("xmllint not found. schema_test won't be run")
message(WARNING "xmllint not found. schema_test won't be run")
endif()

gz_build_tests(TYPE ${TEST_TYPE}
Expand Down
Loading