-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathtest
executable file
·57 lines (49 loc) · 1.41 KB
/
test
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
#!/bin/bash
set -e # exit on failure
function xcode_tests {
(
set -e;
set -x; # print commands executed; use subshell to avoid having to print 'set +x' to disable it
# Run Tests via OS X
xcodebuild test -workspace Snorlax.xcworkspace -scheme Snorlax-OSX -destination "platform=OS X" &&
# Run Tests via iOS
xcodebuild test -workspace Snorlax.xcworkspace -scheme Snorlax-iOS -destination "platform=iOS Simulator,name=iPhone 6,OS=9.2" &&
# Run Tests via tvOS
xcodebuild test -workspace Snorlax.xcworkspace -scheme Snorlax-tvOS -destination "platform=tvOS Simulator,name=Apple TV 1080p,OS=9.1"
)
echo
echo "Xcode tests passed"
}
function spm_tests {
(
set -e;
set -x; # print commands executed; use subshell to avoid having to print 'set +x' to disable it
swift build --clean &&
swift build &&
swift test
)
echo
echo "SPM tests passed"
}
function help {
echo "Usage: $0 COMMANDS..."
echo
echo "Runs specific test suites."
echo
echo "COMMANDS:"
echo " spm: runs tests via Swift Package Manager (Linux)"
echo " xcode: runs tests via Xcode (OS X, iOS, tvOS)"
echo " help: Displays this help"
echo
}
for arg in "$@"
do
case $arg in
"spm") spm_tests;;
"xcode") xcode_tests;;
"help") help;;
esac
done
if [ $# == 0 ]; then
help
fi