Improve error messages when embedSdf.py fails #1549
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🦟 Bug fix
Follow-up to #1536.
Summary
The embedSdf.py script is used to generate the
EmbeddedSdf.cc
source code that implements the interface defined in src/EmbeddedSdf.hh. The contribution by @ efferre79 in #1536 adds error checking to confirm that the generatedEmbeddedSdf.cc
file is not empty. This pull request makes some additional improvements to this error checking.a44ccb2: check that
EmbeddedSdf.cc
exists before checking its size, use string comparisons, and rephrase the error messageCurrently the
file(SIZE)
call generates a cmake error if theEmbeddedSdf.cc
file does not exist and theif(${OUT_SIZE} EQUAL 0)
comparison fails ifOUT_SIZE
is an empty variable:After a44ccb2, the error message when EmbeddedSdf.cc is empty or does not exist changes to:
1ca9bb6: check return code of embedSdf.py and print stderr
This checks the
RESULT_VARIABLE
of theexecute_process
call and prints theERROR_VARIABLE
if it is not successful. After this change, the error message is:Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.