#!/bin/sh -ex

rm -rf data

mkdir data
for n in ref new opt; do

        case $n in
        ref)    flags=;;
        new)    flags=-n;;
        opt)    flags="-n -o";;
        esac

	mkdir data/$n
        for m in out expr prof; do
                case $m in
                out)    more=-s;;
                expr)   more=-e;;
                prof)   more=-p;;
                esac

                mkdir data/$n/$m
                ./runs $flags $more data/$n/$m || exit
        done
done