Skip to content

Commit 232fbce

Browse files
authored
Fix src/tests/build.sh argument processing (#81836)
The logic to process test filter args isn't working correctly because the `shift` happens inside a sourced script, and doesn't actually shift the outer arguments. The right way to do this is via `__ShiftArgs`. Without this fix, `tree nativeaot` was working because `nativeaot` happened to be a supported argument as well. With the fix, other test subtrees work as expected.
1 parent ad52afd commit 232fbce

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/tests/build.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,8 +239,8 @@ handle_arguments_local() {
239239
local arg="$1"
240240
local parts=(${arg//:/ })
241241
if [[ ${#parts[@]} -eq 1 ]]; then
242-
shift
243-
__BuildTestProject="$__BuildTestProject$1%3B"
242+
__BuildTestProject="$__BuildTestProject$2%3B"
243+
__ShiftArgs=1
244244
else
245245
__BuildTestProject="$__BuildTestProject${parts[1]}%3B"
246246
fi
@@ -250,8 +250,8 @@ handle_arguments_local() {
250250
local arg="$1"
251251
local parts=(${arg//:/ })
252252
if [[ ${#parts[@]} -eq 1 ]]; then
253-
shift
254-
__BuildTestDir="$__BuildTestDir$1%3B"
253+
__BuildTestDir="$__BuildTestDir$2%3B"
254+
__ShiftArgs=1
255255
else
256256
__BuildTestDir="$__BuildTestDir${parts[1]}%3B"
257257
fi
@@ -261,8 +261,8 @@ handle_arguments_local() {
261261
local arg="$1"
262262
local parts=(${arg//:/ })
263263
if [[ ${#parts[@]} -eq 1 ]]; then
264-
shift
265-
__BuildTestTree="$__BuildTestTree$1%3B"
264+
__BuildTestTree="$__BuildTestTree$2%3B"
265+
__ShiftArgs=1
266266
else
267267
__BuildTestTree="$__BuildTestTree${parts[1]}%3B"
268268
fi
@@ -304,8 +304,8 @@ handle_arguments_local() {
304304
local arg="$1"
305305
local parts=(${arg//:/ })
306306
if [[ ${#parts[@]} -eq 1 ]]; then
307-
shift
308-
__BuildLogRootName="$1"
307+
__BuildLogRootName="$2"
308+
__ShiftArgs=1
309309
else
310310
__BuildLogRootName="${parts[1]}"
311311
fi

0 commit comments

Comments
 (0)