Skip to content

Commit ab0b423

Browse files
committed
fixup test script
1 parent 9869291 commit ab0b423

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

eng/scripts/get-aspire-cli.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ DEFAULT_QUALITY="release"
3030

3131
# Function to show help
3232
show_help() {
33-
cat << 'EOF'
33+
cat << EOF
3434
Aspire CLI Download Script
3535
3636
DESCRIPTION:

eng/scripts/tests/test-get-aspire-cli.ps1

100644100755
File mode changed.

eng/scripts/tests/test-utils.sh

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,12 @@ initialize_test_framework() {
8080
# Create a top-level temporary directory for all test operations
8181
local test_id
8282
test_id=$(date +%s%N | cut -b1-13) # Use timestamp for uniqueness
83-
TOP_LEVEL_TEST_DIR=$(mktemp -d -t "aspire-cli-tests-${test_id}")
83+
# Use a cross-platform mktemp pattern:
84+
# macOS: mktemp -d -t prefix (suffix with random chars automatically)
85+
# GNU coreutils: requires at least 3 X's in the template. The form -t expects a template
86+
# that includes the X's (it does NOT auto-append like BSD). So we append -XXXXXX to satisfy GNU.
87+
# Using a unified pattern works on both platforms.
88+
TOP_LEVEL_TEST_DIR=$(mktemp -d -t "aspire-cli-tests-${test_id}-XXXXXX")
8489

8590
if [[ "$TEST_VERBOSE" == "true" ]]; then
8691
write_colored_output "Test framework initialized with verbose output" "BLUE"
@@ -122,13 +127,14 @@ write_test_result() {
122127
local status="$2"
123128
local details="${3:-}"
124129

125-
((TESTS_TOTAL++))
130+
# Use prefix increment so arithmetic command exits with status 0 under set -e
131+
((++TESTS_TOTAL))
126132

127133
if [[ "$status" == "PASS" ]]; then
128-
((TESTS_PASSED++))
134+
((++TESTS_PASSED))
129135
write_colored_output "✓ PASS: $test_name" "GREEN"
130136
else
131-
((TESTS_FAILED++))
137+
((++TESTS_FAILED))
132138
write_colored_output "✗ FAIL: $test_name" "RED"
133139
fi
134140

0 commit comments

Comments
 (0)