summaryrefslogtreecommitdiff
path: root/src/templating/dotest.sh
blob: 99ff8b201df686dc0b80ac2f2460145af12335ae (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

mustach=${mustach:-../mustach}
echo starting test
if test "$NOVALGRIND" = 1
then
	$mustach "$@" > resu.last
else
	valgrind $mustach "$@" > resu.last 2> vg.last
	sed -i 's:^==[0-9]*== ::' vg.last
	awk '/^ *total heap usage: .* allocs, .* frees,.*/{if($$4-$$6)exit(1)}' vg.last || echo "ERROR! Alloc/Free issue"
fi
if diff -w resu.ref resu.last
then
	echo "result ok"
else
	echo "ERROR! Result differs"
fi
echo