#!/bin/bash

TESTS_DIR="."
#mkdir $TESTS_DIR

g++ -O2 -std=c++11 testgen.cpp -o test_gen
./test_gen

cp ../author/pesho.cpp .
g++ -O2 -std=c++11 pesho.cpp -o author

for in_file in "$TESTS_DIR"/*.in; do
    if [[ -f "$in_file" ]]; then
	out_file="${in_file%.in}.out"
        echo "Processing $out_file"
	./author < $TESTS_DIR/$in_file > $TESTS_DIR/$out_file
    fi
done

rm author
rm author.cpp
rm test_gen
rm -f test_gen.o
rm -f test_gen.exe

