forked from yandod/candycane
-
Notifications
You must be signed in to change notification settings - Fork 0
/
coverage.sh
40 lines (34 loc) · 980 Bytes
/
coverage.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
37
38
39
40
#!/bin/sh
root_dir=`pwd`
simpletest_coverage_dir="$root_dir/vendors/simpletest/extensions/coverage"
php_option="-d include_path=.:/usr/share/pear:$simpletest_coverage_dir -d auto_prepend_file=$simpletest_coverage_dir/autocoverage.php"
start() {
php $php_option $simpletest_coverage_dir/bin/php-coverage-open.php --include=$root_dir/app/controllers/.*\.php$ --include=$root_dir/app/models/.*\.php$ --include=$root_dir/app/vendors/candycane/.*\.php$ v--exclude='$root_dir/.*/tests/.*' --maxdepth=1
}
close() {
php $php_option $simpletest_coverage_dir/bin/php-coverage-close.php
}
test() {
php $php_option $root_dir/cake/console/cake.php testsuite app all
}
report() {
php $php_option $simpletest_coverage_dir/bin/php-coverage-report.php
}
case "$1" in
start)
start
;;
close)
close
;;
report)
report
;;
test)
test
;;
all) start; test; close; report;
;;
*)
echo "start|test|close|report|all"
esac