forked from Kitura/Kitura-NIO
-
Notifications
You must be signed in to change notification settings - Fork 1
/
.kitura-test.sh
44 lines (38 loc) · 1.18 KB
/
.kitura-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
# Run Kitura-NIO tests
travis_start "swift_test"
echo ">> Executing Kitura-NIO tests"
swift test
SWIFT_TEST_STATUS=$?
travis_end
if [ $SWIFT_TEST_STATUS -ne 0 ]; then
echo ">> swift test command exited with $SWIFT_TEST_STATUS"
# Return a non-zero status so that Package-Builder will generate a backtrace
return $SWIFT_TEST_STATUS
fi
# Clone Kitura
set -e
echo ">> Building Kitura"
travis_start "swift_build_kitura"
cd .. && git clone https://github.com/IBM-Swift/Kitura && cd Kitura
# Set KITURA_NIO
export KITURA_NIO=1
# Build once
swift build
# Edit package Kitura-NIO to point to the current branch
echo ">> Editing Kitura package to use latest Kitura-NIO"
swift package edit Kitura-NIO --path ../Kitura-NIO
travis_end
set +e
# Run Kitura tests
travis_start "swift_test_kitura"
echo ">> Executing Kitura tests"
swift test
SWIFT_TEST_STATUS=$?
travis_end
if [ $SWIFT_TEST_STATUS -ne 0 ]; then
echo ">> swift test command exited with $SWIFT_TEST_STATUS"
# Return a non-zero status so that Package-Builder will generate a backtrace
return $SWIFT_TEST_STATUS
fi
# Move back to the original build directory. This is needed on macOS builds for the subsequent swiftlint step.
cd ../Kitura-NIO