Files
lean4/tests/pkg/leanchecker/run_test
Garmelon 6a2a884372 chore: migrate pkg tests (#12889)
Also refactor util.sh in the process, so test scripts become easier to
write (inspired in part by lake's test suite).
2026-03-11 18:55:46 +00:00

27 lines
726 B
Bash
Executable File

#!/usr/bin/env bash
source ../../env_test.sh
rm -rf .lake/build
lake build
for f in LeanCheckerTests/*.lean; do
module="LeanCheckerTests.$(basename "$f" .lean)"
# Check for --fresh mode test
if [[ -f "$f.fresh" ]]; then
capture_only "$f" \
lake env leanchecker --fresh "$module"
check_exit_is_fail
check_out_file
# Check for normal mode test
elif [[ -f "$f.out.expected" ]]; then
# Expect failure with specific output
capture_only "$f" \
lake env leanchecker "$module"
check_exit_is_fail
check_out_file
else
# No expected output files - expect success (exit 0)
run lake env leanchecker "$module"
fi
done