#!/bin/sh

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

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

# generate
./gen > tests.gen || doall_fail "gen failed"
'./split' tests.manual tests.gen || doall_fail "split failed"
rm tests.gen || doall_fail "rm failed o_O"

