@@ -60,6 +60,9 @@ if [[ $rc -ne 0 ]]; then
6060 exit 1
6161fi
6262grep -q ' Installed' /tmp/_inst.log || { cat /tmp/_inst.log; echo " FAIL: no Installed line" ; exit 1; }
63+ # Both accepted spellings should work when the payload is already installed.
64+ " $MCPP " toolchain install gcc@16.1.0 > /tmp/_inst_at.log 2>&1 || {
65+ cat /tmp/_inst_at.log; echo " FAIL: @-form install failed" ; exit 1; }
6366
6467# 4) toolchain list now non-empty
6568out=$( " $MCPP " toolchain list 2>&1 )
@@ -71,6 +74,10 @@ echo "$out" | grep -q '16.1.0' || { echo "FAIL: list missing version: $out"; exi
7174grep -q ' Default' /tmp/_def.log || { cat /tmp/_def.log; echo " FAIL: no Default msg" ; exit 1; }
7275out=$( " $MCPP " toolchain list 2>&1 )
7376echo " $out " | grep -q ' \*' || { echo " FAIL: default mark missing: $out " ; exit 1; }
77+ " $MCPP " toolchain default gcc 16.1.0 > /tmp/_def_split.log 2>&1 || {
78+ cat /tmp/_def_split.log; echo " FAIL: space-separated default failed" ; exit 1; }
79+ grep -q ' Default' /tmp/_def_split.log || {
80+ cat /tmp/_def_split.log; echo " FAIL: no Default msg for space-separated form" ; exit 1; }
7481
7582# 6) Build now succeeds (project has no [toolchain]; uses global default)
7683" $MCPP " build > /tmp/_build.log 2>&1 || { cat /tmp/_build.log; echo " FAIL: build failed" ; exit 1; }
@@ -98,8 +105,22 @@ echo "$out" | grep -q 'default toolchain = gcc@16.1.0' || {
98105
99106# 9) Remove
100107rm -rf target
101- " $MCPP " toolchain remove gcc@16.1.0 > /tmp/_rm.log 2>&1
102- grep -q ' Removed' /tmp/_rm.log || { cat /tmp/_rm.log; echo " FAIL: no Removed msg" ; exit 1; }
108+ " $MCPP " toolchain remove gcc 16.1.0 > /tmp/_rm.log 2>&1
109+ grep -q ' Removed' /tmp/_rm.log || { cat /tmp/_rm.log; echo " FAIL: no Removed msg for space-separated form" ; exit 1; }
110+ # The issue's cross-target spelling should parse too and reach the payload
111+ # lookup, even when that target is not installed in this test workspace.
112+ rc=0
113+ " $MCPP " toolchain remove gcc 16.1.0 --target x86_64-linux-musl > /tmp/_rm_target.log 2>&1 || rc=$?
114+ [[ " $rc " -ne 0 ]] || { echo " FAIL: removing an absent target toolchain should fail" ; exit 1; }
115+ grep -q ' is not installed' /tmp/_rm_target.log || {
116+ cat /tmp/_rm_target.log; echo " FAIL: split form with --target did not reach installed-payload check" ; exit 1; }
117+ # The compact spelling remains valid too; after removal it should reach the
118+ # installed-payload check rather than fail spec parsing.
119+ rc=0
120+ " $MCPP " toolchain remove gcc@16.1.0 > /tmp/_rm_at.log 2>&1 || rc=$?
121+ [[ " $rc " -ne 0 ]] || { echo " FAIL: removing an absent toolchain should fail" ; exit 1; }
122+ grep -q ' is not installed' /tmp/_rm_at.log || {
123+ cat /tmp/_rm_at.log; echo " FAIL: @-form remove did not reach installed-payload check" ; exit 1; }
103124
104125# 10) After removing, the toolchain dir is gone, but config.toml still
105126# points to it as default. Verify list shows nothing for that compiler now.
0 commit comments