Skip to content
Closed
Changes from all commits
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
11 changes: 6 additions & 5 deletions run_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ MYPY_PROTOBUF_VENV=venv_$PY_VER_MYPY_PROTOBUF
fi
)

ERRORS=()
ERROR_FILE=$(mktemp)
trap 'rm -f "$ERROR_FILE"' EXIT

for PY_VER in $PY_VER_UNIT_TESTS; do
UNIT_TESTS_VENV=venv_$PY_VER
Expand Down Expand Up @@ -202,7 +203,7 @@ for PY_VER in $PY_VER_UNIT_TESTS; do
cp "$MYPY_OUTPUT/mypy_output.omit_linenos" "test_negative/output.expected.$PY_VER_MYPY_TARGET.omit_linenos"

# Record error instead of echoing and exiting
ERRORS+=("test_negative/output.expected.$PY_VER_MYPY_TARGET didnt match. Copying over for you.")
echo "test_negative/output.expected.$PY_VER_MYPY_TARGET didnt match. Copying over for you." >> "$ERROR_FILE"
fi
)

Expand All @@ -214,11 +215,11 @@ for PY_VER in $PY_VER_UNIT_TESTS; do
done

# Report all errors at the end
if [ ${#ERRORS[@]} -gt 0 ]; then
if [ -s "$ERROR_FILE" ]; then
echo -e "\n${RED}===============================================${NC}"
for error in "${ERRORS[@]}"; do
while IFS= read -r error; do
echo -e "${RED}$error${NC}"
done
done < "$ERROR_FILE"
echo -e "${RED}Now rerun${NC}"
exit 1
fi
Loading