-
Notifications
You must be signed in to change notification settings - Fork 31
/
runtests.sh
executable file
·89 lines (70 loc) · 2.51 KB
/
runtests.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#!/bin/bash
# shell script to run all tap tests
if (( $# < 2 )); then
echo ""
echo "$0 username password [--filter hastap|matching|eq|moretap|todotap|utils|viewtap|coltap|routinestap|triggertap]"
echo ""
exit 0
fi
USER="$1"; shift
PASSW="$1"; shift
# find out if we want to filter to a specific set
FILTER="$@"
if [[ ${FILTER:0:8} = "--filter" ]]; then
# strip the --filter prefix
FILTER=${FILTER:8}
# reset to everything when the filter is empty
if [[ "$FILTER" == "" ]]; then
FILTER=0
fi
else
# no filtering
FILTER=0
fi
MYSLOPTS="-h 127.0.0.1 -u $USER -p$PASSW --disable-pager --batch --raw --skip-column-names --unbuffered"
echo "============= updating tap ============="
mysql $MYSLOPTS --execute 'source ./mytap.sql'
if [[ $FILTER != 0 ]]; then
echo "============= filtering ============="
echo "$FILTER"
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "hastap" ]]; then
echo "============= hastap ============="
mysql $MYSLOPTS --database tap --execute 'source tests/hastap.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "matching" ]]; then
echo "============= matching ============="
mysql $MYSLOPTS --database tap --execute 'source tests/matching.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "eq" ]]; then
echo "============= eq ============="
mysql $MYSLOPTS --database tap --execute 'source tests/eq.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "moretap" ]]; then
echo "============= moretap ============="
mysql $MYSLOPTS --database tap --execute 'source tests/moretap.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "todotap" ]]; then
echo "============= todotap ============="
mysql $MYSLOPTS --database tap --execute 'source tests/todotap.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "utils" ]]; then
echo "============= utils ============="
mysql $MYSLOPTS --database tap --execute 'source tests/utils.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "viewtap" ]]; then
echo "============= viewtap ============="
mysql $MYSLOPTS --database tap --execute 'source tests/viewtap.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "coltap" ]]; then
echo "============= coltap ============="
mysql $MYSLOPTS --database tap --execute 'source tests/coltap.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "routinestap" ]]; then
echo "============= routinestap ========"
mysql $MYSLOPTS --database tap --execute 'source tests/routinestap.my'
fi
if [[ $FILTER == 0 ]] || [[ $FILTER =~ "triggertap" ]]; then
echo "============= triggertap ========"
mysql $MYSLOPTS --database tap --execute 'source tests/triggertap.my'
fi