#!/bin/bash

FILE=$1

if [ -z "$FILE" ]
then
	printf "\nusage: $0 [filename without .png]\n\n"
	exit 1
fi

#remove existing file
rm -f ${FILE}.png

#get it
printf "4\n9\n${FILE}.png\n0\n" | $(dirname $0)/test_hpcalcs.sh

#got it
if [ ! -r "${FILE}.png" ]
then
	printf "\nerror: cannot read ${FILE}.png, screenshot failed!\n\n"
	exit 1
fi

