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
30 changes: 22 additions & 8 deletions tests/e2e/239_msvc_managed_toolset.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,30 @@ restore() {
trap restore EXIT
cd "$TMP"

# 1) install it. This runs BEFORE the discoverability check below, so that a
# runner which cannot reach the index skips instead of failing an assertion
# about a list the index would have filled in.
# 0) Decide SKIP here, from a positive check, and never again.
#
# ⚠️ This used to be decided AFTER the install by pattern-matching the
# failure text, and one of the patterns was `*"index"*`. Nearly every mcpp
# command prints "package index" somewhere, so every genuine install
# failure took the skip branch: the test could pass or skip, never fail.
#
# It hid a real one. `tar -xf "C:\...vsix"` fails under GNU tar, which
# reads `C:` as a hostname ("Cannot connect to C: resolve failed"); the
# install ran for 135 seconds, failed, and this script reported PASS.
#
# A skip has to be decided by what is ABSENT before the work starts, not by
# what the failure looked like afterwards.
if ! "$MCPP" toolchain list 2>&1 | grep -qi "msvc"; then
echo "SKIP: this index offers no msvc toolset (offline runner?)"
exit 0
fi

# 1) install it. Any failure from here on is a FAILURE.
rc=0; out=$("$MCPP" toolchain install msvc "$TOOLSET" 2>&1) || rc=$?
if [[ $rc -ne 0 ]]; then
case "$out" in
*"index"*|*"network"*|*"resolve"*|*"offline"*|*"connect"*|*"not found"*)
echo "SKIP: xim:msvc@$TOOLSET unreachable: $out"; exit 0 ;;
*) echo "FAIL: install msvc $TOOLSET: $out"; exit 1 ;;
esac
echo "FAIL: install msvc $TOOLSET (rc=$rc):"
echo "$out"
exit 1
fi
[[ "$out" == *"$TOOLSET"* ]] \
|| { echo "FAIL: install did not report the toolset: $out"; exit 1; }
Expand Down
Loading