Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
SWIFT_VERSION: ${{ matrix.swift }}
run: cd CompiletimeCrashTests && ./run-compiletime-crash-tests.sh
- name: Upload to Influx
if: ${{ github.event_name == 'push' }}
if: ${{ github.event_name == 'push' || github.event.name == 'schedule' }}
env:
INFLUX_BUCKET_NAME: ${{ secrets.InfluxBucketName }}
INFLUX_UPLOAD_TOKEN: ${{ secrets.InfluxUploadToken }}
Expand Down
23 changes: 13 additions & 10 deletions CompiletimeCrashTests/run-compiletime-crash-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,22 @@ if [[ $OSTYPE == 'darwin'* ]]; then
export SDKROOT=$(xcrun --sdk macosx --show-sdk-path)
fi

# Use indexed arrays instead of associative arrays
test_keys=()
test_values=()

declare -A test_results

for folder in $(find . -type d -mindepth 1 -maxdepth 1 | sed 's|^\./||'); do
let total_count+=1
cd "$folder" # navigate to current testing folder
cd "$folder" || exit 1 # navigate to current testing folder, avoid silent failures
echo "Building and checking output of $folder"
reproducer_type=`source ./build.sh`
RETURN_CODE=$?
echo "Finished building $folder"
cd - > /dev/null # navigate back to previous folder
test_results[$folder]=$reproducer_type
cd - > /dev/null || exit 1 # navigate back to previous folder, avoid silent failure
# script expected to succeed
test_keys+=("$folder")
test_values+=("$reproducer_type")
if [ $RETURN_CODE -eq 0 ]; then
# script succeeded
echo -e "$folder: $reproducer_type\n"
Expand All @@ -35,17 +38,17 @@ done

# format JSON
json="{"
first=1
for test in "${!test_results[@]}"; do
value=${test_results[$test]}
if [[ $first -eq 0 ]]; then
for i in "${!test_keys[@]}"; do
key=${test_keys[$i]}
value=${test_values[$i]}
if [ $i -ne 0 ]; then
json+=", "
fi
json+="\"$test\": \"$value\" "
first=0
json+="\"$key\": \"$value\""
done
json+="}"

echo "TRACE: ${json}"
echo $json > compiletime-crash-test-results.json

echo "Finished running all Compiletime Crash tests"
Expand Down