File: run

package info (click to toggle)
harec 0.26.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,480 kB
  • sloc: ansic: 20,054; asm: 335; makefile: 116; lisp: 80; sh: 45
file content (33 lines) | stat: -rwxr-xr-x 541 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/sh
printf 'Running harec test suite at %s\n\n' "$(date)"
start=$(date +"%s")

ntests=0
npass=0
nfail=0

for f in ./tests/*
do
	if [ -x "$f" ] && [ "$f" != "./tests/run" ]
	then
		ntests=$((ntests+1))
		name="$(basename "$f")"
		printf '%-20s ...' "$name"
		if $f
		then
			npass=$((npass+1))
			printf 'PASS\n'
		else
			nfail=$((nfail+1))
			printf 'FAIL\n'
		fi
	fi
done

finish=$(date +"%s")
printf '\n%d tests:\t%d passed\t%d failed\tin %d seconds\n' \
	$ntests $npass $nfail $((finish-start))
if [ $nfail -ne 0 ]
then
	exit 1
fi