aboutsummaryrefslogtreecommitdiff
path: root/scripts/gen-report
blob: 9b86174115de82da17ed4033b959d024b6a6ef84 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh

BUILD=build

while getopts "d:" opt; do
	case "$opt" in
		d) BUILD="$OPTARG";;
		*) echo "unregonised option -$OPTARG" >&2; exit 1;;
	esac
done

shift $((OPTIND - 1))

for p in "$@"; do
	mkdir -p "reports/${p}"
	timeout --foreground 30s valgrind -q \
		--leak-check=full            \
		--error-exitcode=1           \
		"./${BUILD}/${p}" > "reports/${p}/log"
done