-
Notifications
You must be signed in to change notification settings - Fork 2
/
dev-test.sh
executable file
·80 lines (69 loc) · 1.58 KB
/
dev-test.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
#!/bin/bash
# This file is part of marionette-go
#
# marionette-go is distributed in two licenses: The Mozilla Public License,
# v. 2.0 and the GNU Lesser Public License.
#
# marionette-go is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE.
#
# See License.txt for further information.
DIR="/go/src/github.com/raohwork/marionette-go"
mkdir -p .cache/opt
function runtest {
echo ''
echo ''
echo "Test ${3} against Go ${1} Firefox ${2}"
GOV="$1"
FXV="$2"
PKG="$3"
shift; shift; shift
docker run --rm \
-v "$(pwd):${DIR}" \
-v "$(pwd)/.cache/opt:/opt" \
-v "$(pwd)/.cache:/home/user" \
-e "HOME=/home/user" \
-e "GO_VER=${GOV}" \
-e "FX_VER=${FXV}" \
--workdir "$DIR" \
--user "${UID}:${GID}" \
ronmi/go-firefox \
go test -p 2 -bench . -benchmem "$PKG" "$@"
}
CNT=0
MAX=3
if [[ $DEBUG != "" ]]
then
MAX=1
fi
function jobc {
CNT=$((CNT+1))
if [[ $CNT -ge $MAX ]]
then
wait
CNT=0
fi
}
set -e
for go in 1.10.8 1.11.5 1.12
do
for fx in 66.0b9 66.0b12
do
for pkg in . ./mnsender ./mnclient ./tabmgr
do
runtest $go $fx $pkg &
jobc
done
done
done
for go in 1.10.8 1.11.5 1.12
do
for fx in 64.0 65.0
do
echo "Test tabmgr against Go ${go} Firefox ${fx}"
runtest $go $fx ./tabmgr -run TestTabManager &
jobc
done
done
wait