-
Notifications
You must be signed in to change notification settings - Fork 98
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
Encode XML path and line number in Element and add XML path setter Error. #548
Conversation
7a3a599
to
5f437b5
Compare
Codecov Report
@@ Coverage Diff @@
## sdf11 #548 +/- ##
==========================================
- Coverage 87.46% 87.43% -0.03%
==========================================
Files 72 72
Lines 10349 10421 +72
==========================================
+ Hits 9052 9112 +60
- Misses 1297 1309 +12
Continue to review full report at Codecov.
|
@osrf-jenkins run test |
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.
Nice work on constructing the xml path during parsing. I have a couple of minor comments as well a comment about the ABI test failure that we should address. I did notice that in the description of this PR, you said this closes #226, but that issue is about associating line numbers with sdf::Element
. Are you planning to add that to this PR or should that come later in another PR?
1ae7778
to
7c04c40
Compare
FYI @SeanCurtis-TRI |
@aaronchongth Can you update PR title to explicitly mention line numbers? |
Per VC, @aaron is updating the parser to set line numbers on |
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.
LGTM! A few minor nit suggestions
Can you update PR review to say: I'm not sure if GitHub recognizes / parses |
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.
Awesome! (pending merge/de-conflict and remaining discussion items)
@EricCousineau-TRI I've linked the issue so it should close both regardless |
Ah, sweet - thanks for clarifying / correcting me! |
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Apologies for the delay! I had some trouble getting my tests to pass for nested models and just managed to solve it, 1d46a84. Thanks for the reviews so far! |
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
@osrf-jenkins run test |
…/model.sdf regardless Signed-off-by: Aaron Chong <[email protected]>
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.
Looks good! The only thing that needs changed is the input for sdf::testing::TestFile
. The other comments are just a suggestion and minor question.
Signed-off-by: Aaron Chong <[email protected]>
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.
Great work!!
…parated arguments in sdf::testing::TestFile Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
Signed-off-by: Aaron Chong <[email protected]>
@osrf-jenkins run test |
Signed-off-by: Aaron Chong <[email protected]>
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.
LGTM!
#548 introduced a behavior change on `sdf::Element::FilePath()` for elements loaded from strings. Before that PR, `FilePath()` returned `""` for such elements, but presently, it returns either `data-string` or `<data-string>`. This behavior change could cause failures in downstream applications once released (I know the test `INTEGRATION_save_world` in ign-gazebo will have test failures). Signed-off-by: Addisu Z. Taddese <[email protected]>
🎉 New feature
Closes #226 and #510
Summary
This encodes the XML path and line number information into each
Element
during parsing, and further adds the XML path information into the errors that occur, specifically whenreadXml
is called.Changes to
sdf::Error
:XmlPath
setter and getter to the API<<
now handles printouts depending on availability ofXmlPath
,FilePath
andLineNumber
Error Code #: [XML_PATH]: Msg: ...
Error Code #: [XML_PATH:FILE_PATH]: Msg: ...
Error Code #: [XML_PATH:FILE_PATH:L#]: Msg: ...
Changes to
sdf::Element
:XmlPath
andLineNumber
test/integration/element_tracing.cc
Changes to
Utils
:sdfwarn
andsdfdbg
Changes to
parser
:Test it
source ws/install/setup.bash ./ws/build/sdformat11/src/UNIT_Error_TEST ./ws/build/sdformat11/src/UNIT_Element_TEST ./ws/build/sdformat11/src/UNIT_Utils_TEST ./ws/build/sdformat11/src/UNIT_parser_TEST ./ws/build/sdformat11/test/integration/INTEGRATION_element_tracing
Testing with
ign sdf -k
We would expect the top of the error message stack to be,
Checklist
sh tools/code_check.sh
)another open pull request
to support the maintainers
Note to maintainers: Remember to use Squash-Merge