trustme.sh 793 Bytes
Newer Older
1
#!/bin/bash
2 3 4 5 6 7 8 9 10 11

# This script re-generates the reference files used by test.sh for comparison.
# One should call it only when one trusts that Menhir is currently working!

. ./config.sh

# Make sure Menhir and MenhirLib are up-to-date.
./build.sh

# Build the parser with the code back-end and run it.
12
echo "Building (code)..."
13
make -C $CALC clean >/dev/null
POTTIER Francois's avatar
POTTIER Francois committed
14
make -C $CALC MENHIR="$MENHIR --trace" >/dev/null
15
for f in $DATA/*.real.in ; do
16
  b=${f%.in}
17
  echo "($b) Reconstructing reference output and trace..."
18
  $CALC/calc < $f > $b.ref.out 2> $b.ref.err
19
done
20 21

# Run the reference interpreter.
22
for f in $DATA/*.ideal.in ; do
23 24
  b=${f%.in}
  echo "($b) Reconstructing reference output and trace..."
25
  $MENHIR --trace --interpret $CALC/parser.mly < $f > $b.ref.out 2> $b.ref.err
26
done
27 28

echo "Done."