-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathruntest.sh
36 lines (30 loc) · 1001 Bytes
/
runtest.sh
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
34
35
36
#!/bin/bash
if [[ "$1" == "profile" ]] ; then
echo "profiling code"
perl -d:NYTProf ./tests/runtests.pl
rm -rf nytprof.old || echo "no old to remove"
mv nytprof nytprof.old
nytprofhtml --open
elif [[ "$1" == "cover" ]] ;then
rm -rf cover_db || echo "no old cover to remove"
echo -n " checking code coverage"
if [[ -e "$2" ]] ; then
echo " of $2"
HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,^/,tests/ prove tests/Test${2##lib/}
cover -summary|grep "$2\|---\|^File"
else
echo
HARNESS_PERL_SWITCHES=-MDevel::Cover=+ignore,^/,tests/ prove tests/*.pm
cover -summary
fi
chmod -R 755 cover_db
else
echo -n "quick test"
if [[ -e "$1" ]] ; then
echo " of $1"
prove --timer --normalize -t -w --norc -s -j9 -l lib/ -v tests/Test${1##lib/}
else
echo
prove tests/*.pm --timer --normalize -t -w --norc -s -j9 -l lib/ -v
fi
fi