Skip to content

Commit

Permalink
Use DEPRECATION instead of WARNING for package deprecation messages
Browse files Browse the repository at this point in the history
This makes it possible to treat the warnings differently in downstream packages.
Refer to the CMake documentation for more info: https://cmake.org/cmake/help/v3.0/command/message.html

Signed-off-by: Jose Luis Rivero <jrivero@osrfoundation.org>
  • Loading branch information
j-rivero committed Apr 27, 2020
1 parent 73a7904 commit b1d0eae
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ament_cmake_test/ament_cmake_test/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def main(argv=sys.argv[1:]):
# in case the command segfaults or timeouts and does not generate one
failure_result_file = _generate_result(
args.result_file,
failure_message='The test did not generate a result file.')
error_message='The test did not generate a result file.')
with open(args.result_file, 'w') as h:
h.write(failure_result_file)

Expand Down Expand Up @@ -237,7 +237,7 @@ def log(msg, **kwargs):
# regenerate result file to include output / exception of the invoked command
failure_result_file = _generate_result(
args.result_file,
failure_message='The test did not generate a result file:\n\n' + output)
error_message='The test did not generate a result file:\n\n' + output)
with open(args.result_file, 'w') as h:
h.write(failure_result_file)
else:
Expand Down Expand Up @@ -293,7 +293,7 @@ def log(msg, **kwargs):
return rc


def _generate_result(result_file, *, failure_message=None, skip=False):
def _generate_result(result_file, *, failure_message=None, skip=False, error_message=None):
# the generated result file must be readable
# by any of the Jenkins test result report publishers
pkgname = os.path.basename(os.path.dirname(result_file))
Expand All @@ -304,17 +304,18 @@ def _generate_result(result_file, *, failure_message=None, skip=False):
'<skipped type="skip" message="">![CDATA[Test Skipped by developer]]</skipped>' \
if skip else ''
return """<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="%s" tests="1" failures="%d" time="0" errors="0" skipped="%d">
<testsuite name="%s" tests="1" failures="%d" time="0" errors="%d" skipped="%d">
<testcase classname="%s" name="%s.missing_result" time="0">
%s%s
%s%s%s
</testcase>
</testsuite>\n""" % \
(
pkgname,
1 if failure_message else 0,
1 if error_message else 0,
1 if skip else 0,
pkgname, testname,
failure_message, skipped_message
failure_message, skipped_message, error_message
)


Expand Down

0 comments on commit b1d0eae

Please sign in to comment.