Files
lean4/tests/pkg/leanchecker/test.sh
Sebastian Ullrich 1361d733a6 feat: re-integrate lean4checker as leanchecker (#11887)
This PR makes the external checker lean4checker available as the
existing `leanchecker` binary already known to elan, allowing for
out-of-the-box access to it.

---------

Co-authored-by: Kim Morrison <kim@tqft.net>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-08 09:41:33 +00:00

36 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
rm -rf .lake/build
lake build
for f in LeanCheckerTests/*.lean; do
# It would be nicer if `common.sh` did not hardcode a single input file
set -- "$f"
source ../../common.sh
module="LeanCheckerTests.$(basename "$f" .lean)"
# Check for --fresh mode test
if [ -f "$f.fresh.expected.out" ]; then
# Test --fresh mode (expect failure)
expected_ret=1
exec_check lake env leanchecker --fresh "$module"
# Use fresh expected output for comparison
mv "$f.produced.out" "$f.fresh.produced.out"
f_save="$f"
f="$f.fresh"
diff_produced
f="$f_save"
# Check for normal mode test
elif [ -f "$f.expected.out" ]; then
# Expect failure with specific output
expected_ret=1
exec_check lake env leanchecker "$module"
diff_produced
else
# No expected output files - expect success (exit 0)
expected_ret=0
exec_check_raw lake env leanchecker "$module"
fi
done