-
Notifications
You must be signed in to change notification settings - Fork 107
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
(cmake_xmllint) make extensions configurable #479
base: rolling
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,7 +23,7 @@ | |
# @public | ||
# | ||
function(ament_xmllint) | ||
cmake_parse_arguments(ARG "" "MAX_LINE_LENGTH;TESTNAME" "" ${ARGN}) | ||
cmake_parse_arguments(ARG "" "TESTNAME" "PATHS;EXCLUDE;EXTENSIONS" ${ARGN}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It doesn't look like either There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I will check whether I want to add these as well or remove them. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have update the macro to also use the PATHS and EXCLUDE args. (Though these are not use in the |
||
if(NOT ARG_TESTNAME) | ||
set(ARG_TESTNAME "xmllint") | ||
endif() | ||
|
@@ -35,6 +35,14 @@ function(ament_xmllint) | |
|
||
set(result_file "${AMENT_TEST_RESULTS_DIR}/${PROJECT_NAME}/${ARG_TESTNAME}.xunit.xml") | ||
set(cmd "${ament_xmllint_BIN}" "--xunit-file" "${result_file}") | ||
|
||
if(ARG_EXTENSIONS) | ||
list(APPEND cmd "--extensions") | ||
foreach(ext ${ARG_EXTENSIONS}) | ||
list(APPEND cmd "${ext}") | ||
endforeach() | ||
endif() | ||
|
||
list(APPEND cmd ${ARG_UNPARSED_ARGUMENTS}) | ||
|
||
find_program(xmllint_BIN NAMES "xmllint") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This feels a little weird. If the user doesn't specify anything for EXTENSIONS, then we won't pass
--extensions
toament_xmllint
at all, and then that script will choose thexml
extension itself. If the user specifies some EXTENSIONS, then we will always pass--extensions xml
, plus whatever they choose. There is no way for the user to ask for extensions that doesn't includexml
.I think we should do one of two things here:
.xml
.Either way, we should document what we are doing in the documentation to
ament_xmllint
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, I checked the behaviour. When setting
ament_cmake_xmllint_EXTENSIONS
, it will completely overwrite the_extensions
variable. As I useREGEX REPLACE
.