2014-06-29 14:51:09 +00:00
|
|
|
#!/usr/bin/env bash
|
2013-12-20 00:16:56 +00:00
|
|
|
# Script for testing if Lean can parse the output produced by its
|
|
|
|
# pretty printer
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "Usage: test_single_pp.sh [lean-executable-path] [file]"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
ulimit -s 8192
|
|
|
|
LEAN=$1
|
|
|
|
f=$2
|
|
|
|
echo "-- testing $f"
|
2015-03-29 03:29:52 +00:00
|
|
|
"$LEAN" "$f" showenv.l &> "$f.pp.out"
|
|
|
|
if grep "===BEGIN ENVIRONMENT===" "$f.pp.out"; then
|
|
|
|
awk 'BEGIN { SHOW = 0 } { if (SHOW == 1) print $0 } /===BEGIN ENVIRONMENT===/ { SHOW = 1 }' "$f.pp.out" > "$f.pp"
|
|
|
|
rm -f -- "$f.pp.out"
|
|
|
|
if "$LEAN" "$f.pp"; then
|
|
|
|
rm -f -- "$f.pp"
|
2013-12-20 00:16:56 +00:00
|
|
|
echo "-- checked"
|
|
|
|
else
|
|
|
|
echo "-- failed to parse output produced by Lean"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
echo "-- unexpected output produced by Lean"
|
|
|
|
exit 1
|
|
|
|
fi
|