renderpngs.sh 766 Bytes
Newer Older
Christian Müller's avatar
Christian Müller committed
1 2
# /bin/bash
shopt -s nullglob
3
shopt -s globstar
Christian Müller's avatar
Christian Müller committed
4 5
TIMEOUT=1m

6 7 8 9 10
DIR=$1
if [ -z "$DIR" ] 
then
	DIR="*"
fi
Christian Müller's avatar
Christian Müller committed
11 12 13 14 15 16

echo "Gobbling up metrics"

rm -f results/allmetrics.metrics
touch results/allmetrics.metrics

17
for FILE in results/$DIR/**/*.metrics
Christian Müller's avatar
Christian Müller committed
18 19 20 21 22 23
do
	echo "${FILE}:" >> results/allmetrics.metrics
	cat ${FILE} >> results/allmetrics.metrics
	echo -e "\n\n" >> results/allmetrics.metrics
done

24
for FILE in results/$DIR/**/*.png
25
do
Christian Müller's avatar
Christian Müller committed
26
	echo "Deleting ${FILE}"
27 28 29
	rm $FILE
done

30
for FILE in results/$DIR/**/*.dot
Christian Müller's avatar
Christian Müller committed
31 32 33 34 35 36 37 38 39 40 41 42 43 44
do
	NAME=$(basename ${FILE} .dot)
	DIR=$(dirname "${FILE}")
	PIC="${DIR}/${NAME}.png"

	echo "Rendering ${FILE} to ${PIC}"
	if
		timeout ${TIMEOUT} time -p dot -Tpng < ${FILE} >> ${PIC} 
	then
		echo "Finished successfully"
	else
		echo "Timeout after ${TIMEOUT}"
	fi
done