Skip to content

Commit

Permalink
lint_tool_test: On issues, print out patch that broke.
Browse files Browse the repository at this point in the history
Observed issues with recent MacOS CI.
  • Loading branch information
hzeller committed May 4, 2024
1 parent ec69cae commit b5a62c0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 3 additions & 1 deletion .github/workflows/verible-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,9 @@ jobs:
.github/bin/run-clang-tidy-cached.cc --checks="-*"
MacOsBuild:
runs-on: macos-latest
# New MacOS has a broken patch utility:
# //verilog/tools/lint:lint-tool_test trips over a no-newline-at-end-of-file
runs-on: macos-12
steps:

- name: Cancel previous
Expand Down
18 changes: 15 additions & 3 deletions verilog/tools/lint/lint_tool_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -558,8 +558,12 @@ patch_out="$(patch "${TEST_FILE}" "${PATCH_FILE}" 2>&1)"
status="$?"
(( $status )) && {
echo "Expected exit code 0 from 'patch' tool, but got $status"
echo "--- 'patch' output ---"
echo "--- 'patch' output [#1] ---"
echo "$patch_out"
echo "Patch was"
echo "------------------"
cat "${PATCH_FILE}"
echo "------------------"
exit 1
}

Expand Down Expand Up @@ -616,8 +620,12 @@ patch_out="$(cd $TEST_TMPDIR; patch -p1 < "${PATCH_FILE}" 2>&1)"
status="$?"
(( $status )) && {
echo "Expected exit code 0 from 'patch' tool, but got $status"
echo "--- 'patch' output ---"
echo "--- 'patch' output [#2] ---"
echo "$patch_out"
echo "Patch was"
echo "------------------"
cat "${PATCH_FILE}"
echo "------------------"
exit 1
}

Expand Down Expand Up @@ -714,8 +722,12 @@ interactive_autofix_test() {
status="$?"
(( $status )) && {
echo "Expected exit code 0 from 'patch' tool, but got $status"
echo "--- 'patch' output ---"
echo "--- 'patch' output (interactive_autofix_test) ---"
echo "$patch_out"
echo "Patch was"
echo "------------------"
cat "${PATCH_FILE}"
echo "------------------"
exit 1
}

Expand Down

0 comments on commit b5a62c0

Please sign in to comment.