-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathphpu
More file actions
executable file
·61 lines (57 loc) · 1.12 KB
/
phpu
File metadata and controls
executable file
·61 lines (57 loc) · 1.12 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
options=$(getopt -o t:bdoi --long tag:,build,drop,init,output -- "$@")
eval set -- "$options"
while true ; do
case "$1" in
-t|--tag)
t=1
tags="$2"
;;
-b|--build)
build=1
;;
-d|--drop)
drop=1
;;
-i|--init)
init=1
;;
-o|--output)
output=1
;;
--)
shift
break
;;
esac
shift
done
source moodle_libs
# Setup command
if [ "$drop" = 1 ];
then
command="php admin/tool/phpunit/cli/util.php --drop"
elif [ "$init" = 1 ];
then
command="php admin/tool/phpunit/cli/init.php"
elif [ "$build" = 1 ];
then
command="php admin/tool/phpunit/cli/util.php --buildcomponentconfigs"
else
# check for tests specified
if [ "$t" != 1 ];
then
get_tags_path
else
export TAGS=$tags
fi
command="vendor/bin/phpunit -c"
fi
# Process command
if [ -z "$TRAVIS_BUILD_DIR" ];
then
command="exec webserver ${command} ${TAGS}"
process_command
else
eval ${command} ${TAGS}
fi