Skip to content

Commit b36019a

Browse files
committed
test(e2e): 239 asked for a flag that does not exist
`toolchain list --available` is not a thing -- `toolchain list` already prints an "Available toolchains" section. Caught by ci-windows on the first run, which is the right place for it: this test only ever executes there. Also reordered: the install now runs BEFORE the discoverability check, so a runner that cannot reach the index skips cleanly instead of failing an assertion about a list the index would have filled in. And the check became stronger than the one it replaces -- it asserts the INSTALLED toolset shows up, not merely that some msvc row exists, because a toolset that installs and then never appears is indistinguishable from one that did not install.
1 parent fd597b0 commit b36019a

1 file changed

Lines changed: 11 additions & 8 deletions

File tree

tests/e2e/239_msvc_managed_toolset.sh

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,27 @@ restore() {
3636
trap restore EXIT
3737
cd "$TMP"
3838

39-
# 0) the toolset must be OFFERED before it can be pinned. A managed origin
40-
# nobody can discover is not a feature.
41-
out=$("$MCPP" toolchain list --available 2>&1) || true
42-
[[ "$out" == *"msvc"* ]] \
43-
|| { echo "FAIL: msvc absent from --available: $out"; exit 1; }
44-
45-
# 1) install it
39+
# 1) install it. This runs BEFORE the discoverability check below, so that a
40+
# runner which cannot reach the index skips instead of failing an assertion
41+
# about a list the index would have filled in.
4642
rc=0; out=$("$MCPP" toolchain install msvc "$TOOLSET" 2>&1) || rc=$?
4743
if [[ $rc -ne 0 ]]; then
4844
case "$out" in
49-
*"index"*|*"network"*|*"resolve"*|*"offline"*|*"connect"*)
45+
*"index"*|*"network"*|*"resolve"*|*"offline"*|*"connect"*|*"not found"*)
5046
echo "SKIP: xim:msvc@$TOOLSET unreachable: $out"; exit 0 ;;
5147
*) echo "FAIL: install msvc $TOOLSET: $out"; exit 1 ;;
5248
esac
5349
fi
5450
[[ "$out" == *"$TOOLSET"* ]] \
5551
|| { echo "FAIL: install did not report the toolset: $out"; exit 1; }
5652

53+
# 1b) it must now be LISTED. A toolset that installs but never appears is
54+
# indistinguishable from one that did not install, and `toolchain list` is
55+
# where a user looks.
56+
out=$("$MCPP" toolchain list 2>&1)
57+
[[ "$out" == *"msvc"* && "$out" == *"$TOOLSET"* ]] \
58+
|| { echo "FAIL: installed toolset absent from toolchain list: $out"; exit 1; }
59+
5760
# 2) build with it, from a manifest — the path that matters, and the one
5861
# where the version used to be accepted and then ignored.
5962
"$MCPP" new hello_pinned >/dev/null 2>&1

0 commit comments

Comments
 (0)