-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.sh
executable file
·124 lines (122 loc) · 3.15 KB
/
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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
grunt dev;
type="$1";
param="$2";
#Detect the type of test to run
function get_test () {
echo "$1"
echo "$type"
echo "$param"
case "$type" in
test)
echo "Running test '$param'..";
case "$param" in
room-init)
browserify tests/tests/room-init.js | testling -x "$1";
;;
room-connection)
browserify tests/tests/room-connection.js | testling -x "$1";
;;
event)
browserify tests/tests/event.js | testling -x "$1";
;;
socket)
browserify tests/tests/socket.js | testling -x "$1";
;;
api-test)
browserify tests/tests/api-test.js | testling -x "$1";
;;
webrtc)
browserify tests/tests/webrtc.js | testling -x "$1";
;;
peer)
browserify tests/tests/peer.js | testling -x "$1";
;;
message)
browserify tests/tests/message.js | testling -x "$1";
;;
transfer)
browserify tests/tests/transfer.js | testling -x "$1";
;;
async)
browserify tests/tests/async.js | testling -x "$1";
;;
debug)
browserify tests/tests/debug.js | testling -x "$1";
;;
stream)
browserify tests/tests/stream.js | testling -x "$1";
;;
sdp)
browserify tests/tests/sdp.js | testling -x "$1";
;;
helper)
browserify tests/tests/helper.js | testling -x "$1";
;;
screenshare)
browserify tests/tests/screenshare.js | testling -x "$1";
;;
*)
echo "Test '$param' not found.";
esac
;;
bot)
echo "Running bot for test '$param'..";
case "$param" in
room-connection)
browserify tests/bots/room-connection.js | testling -x "$1";
;;
webrtc)
browserify tests/bots/webrtc.js | testling -x "$1";
;;
peer)
browserify tests/bots/peer.js | testling -x "$1";
;;
message)
browserify tests/bots/message.js | testling -x "$1";
;;
transfer)
browserify tests/bots/transfer.js | testling -x "$1";
;;
async)
browserify tests/bots/async.js | testling -x "$1";
;;
sdp)
browserify tests/bots/sdp.js | testling -x "$1";
;;
stream)
browserify tests/bots/stream.js | testling -x "$1";
;;
screenshare)
browserify tests/bots/screenshare.js | testling -x "$1";
;;
*)
echo "Bot '$param' not found.";
esac
;;
*)
echo "Command '$type' not found.";
esac
}
#Detect the platform (similar to $OSTYPE)
OS="`uname`"
case $OS in
Linux)
OS="Linux"
get_test "google-chrome ";
;;
FreeBSD)
OS="FreeBSD"
alias ls="ls -G"
get_test "google-chrome ";
;;
MINGW32_NT-6.1)
OS="Windows"
get_test "start 'C:/Program Files/Google/Chrome/Application/chrome.exe'";
;;
Darwin)
OS='Mac'
get_test "open -a /Applications/Firefox.app";
;;
AIX) ;;
*) echo "OS $OS not recognized";;
esac