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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 23 additions & 2 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ EXPECTED_DIR="test"

lake build

# Initialize variables to track failures
failed_tests=()
failure_count=0

# ignore locale to ensure test `bla` runs before `bla2`
export LC_COLLATE=C

Expand Down Expand Up @@ -36,11 +40,28 @@ for infile in $IN_DIR/*.in; do
echo "$base: FAILED"
# Rename the temporary file instead of removing it
mv "$tmpfile" "${expectedfile/.expected.out/.produced.out}"
exit 1
failed_tests+=("$base")
((failure_count++))
fi

done

# Print summary of failures
if [ ${#failed_tests[@]} -ne 0 ]; then
echo -e "\n=== Test Summary ==="
echo "Failed tests:"
for test in "${failed_tests[@]}"; do
echo "✗ $test"
done
echo -e "\nTotal: $failure_count failed"
echo "=================="
fi

# Run the Mathlib tests
cp lean-toolchain test/Mathlib/
cd test/Mathlib/ && ./test.sh
mathlib_exit_code=$?

# Exit with error if any test failed or if Mathlib tests failed
if [ $failure_count -gt 0 ] || [ $mathlib_exit_code -ne 0 ]; then
exit 1
fi
21 changes: 19 additions & 2 deletions test/Mathlib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
IN_DIR="test"
EXPECTED_DIR="test"

# Initialize variables to track failures
failed_tests=()
failure_count=0

lake exe cache get > /dev/null
lake build Mathlib

Expand Down Expand Up @@ -34,8 +38,21 @@ for infile in $IN_DIR/*.in; do
echo "$base: FAILED"
# Rename the temporary file instead of removing it
mv "$tmpfile" "${expectedfile/.expected.out/.produced.out}"
exit 1
failed_tests+=("$base")
((failure_count++))
fi

done

# Print summary of failures
if [ ${#failed_tests[@]} -ne 0 ]; then
echo -e "\n=== Mathlib Test Summary ==="
echo "Failed tests:"
for test in "${failed_tests[@]}"; do
echo "✗ $test"
done
echo -e "\nTotal: $failure_count failed"
echo "========================"
exit 1
fi

exit 0