From b5a62c035715337b3e9826ce2b7f65ed83447776 Mon Sep 17 00:00:00 2001 From: Henner Zeller Date: Sat, 4 May 2024 15:12:04 -0700 Subject: [PATCH] lint_tool_test: On issues, print out patch that broke. Observed issues with recent MacOS CI. --- .github/workflows/verible-ci.yml | 4 +++- verilog/tools/lint/lint_tool_test.sh | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/verible-ci.yml b/.github/workflows/verible-ci.yml index 9783e2c23..1a4eb48ad 100644 --- a/.github/workflows/verible-ci.yml +++ b/.github/workflows/verible-ci.yml @@ -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 diff --git a/verilog/tools/lint/lint_tool_test.sh b/verilog/tools/lint/lint_tool_test.sh index be9e34443..be90cc770 100755 --- a/verilog/tools/lint/lint_tool_test.sh +++ b/verilog/tools/lint/lint_tool_test.sh @@ -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 } @@ -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 } @@ -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 }