#!/bin/sh

# Compare current StructuredText.py processing against prior versions.
# You should see no output if there are no discrepancies.

regressdir=`dirname $0`
PYTHONPATH=`cd $regressdir/../..; pwd`:$PYTHONPATH
export PYTHONPATH

differences=""
for i in *.stx; do
  stx=$i
  base=`basename $i .stx`
  ref=$base.ref
  new=$base.new
  python ../StructuredText.py $stx > $new
  if cmp $ref $new; then
    :
  else
    differences="$differences $stx"
  fi
done

if [ -n "$differences" ]; then
  echo "Differences encountered processing$differences."
fi
