#!/bin/sh

function doall_fail()
{
  echo "error:" $*
  echo "aborting"
  exit 1
}

echo "compile..."
g++ -O2 -Wall -o gen gen.cpp || doall_fail "compile [gen] failed"
g++ -O2 -Wall -o split split.cpp || doall_fail "compile [split] failed"

echo "generate..."
./gen > tests.gen || doall_fail "gen failed"
./split tests.{manual,gen,manual.end} || doall_fail "split failed"
rm --force tests.gen || doall_fail "rm failed"


