Skip to content
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

avoid printing on stderr if linter successful #88

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
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
Prev Previous commit
print to stderr if lint failed or stdout if lint succeeds
Signed-off-by: Mikael Arguedas <[email protected]>
  • Loading branch information
mikaelarguedas committed Mar 8, 2024
commit fb3542629d182577f7c04dffbb03bc0b21e17f1f
9 changes: 5 additions & 4 deletions scripts/test_wrapper
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ TARGET_NAME=${@: -1}
shift

# Run remain args as test command, capturing the output.
LINTER_OUTPUT=$( $@ 2>&1 )
LINTER_OUTPUT="$( $@ 2>&1 )"
LINTER_RESULT=$?

mkdir -p `dirname $RESULTS_FILE`
if [[ "$LINTER_RESULT" == "0" ]]; then
# Lint pass
echo "$LINTER_OUTPUT"
cat <<ENDXML > $RESULTS_FILE
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="roslint" tests="1" failures="0" errors="0">
Expand All @@ -20,9 +21,9 @@ ENDXML
exit 0
else
# Lint failed
>&2 echo $LINTER_OUTPUT
# TODO: This output could be more helpful; really just a first cut.
cat <<ENDXML > $RESULTS_FILE
echo "$LINTER_OUTPUT" >&2
# TODO: This output could be more helpful; really just a first cut.
cat <<ENDXML > $RESULTS_FILE
<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="roslint" tests="1" failures="1" errors="0">
<testcase name="$TARGET_NAME" classname="roslint.LintCheck">
Expand Down