#!/bin/sh

# This script compiles and verifies all forms in the demo directory.

cd src/demo

for f in *.form; do
    PREFIX=`echo $f | cut -d'.' -f1`
    rm -f $PREFIX.h
    ../bin/ffc $f
    if [ -f $PREFIX.h ]; then
	echo "Form $f compiled"
    else
	echo "*** Unable to compile $f"
	exit 1
    fi
done

for f in *.h; do
    echo "--- Verifying $f ---"
    diff ../reference/$f $f
done
