-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathiostest.sh
More file actions
executable file
·39 lines (30 loc) · 1.04 KB
/
iostest.sh
File metadata and controls
executable file
·39 lines (30 loc) · 1.04 KB
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
#!/bin/bash
rm -rf build/ios
brew install chargepoint/xcparse/xcparse
# Run tests
xcodebuild test -project test/ios/iOSUnitTesting/iOSUnitTesting.xcodeproj -scheme iOSUnitTesting -destination 'platform=macOS' -configuration Debug -resultBundlePath build/ios/TestResults.xcresult
# Check if xcodebuild was successful
if [ $? -ne 0 ]; then
echo "xcodebuild failed to run tests"
exit 2
fi
# Process results
RESULT=$(xcrun xcresulttool get --format json --path build/ios/TestResults.xcresult)
# Check if xcresulttool was successful
if [ $? -ne 0 ]; then
echo "Failed to process test results"
exit 3
fi
# Extract test status
TEST_STATUS=$(echo $RESULT | jq -r '.issues.testFailureSummaries | length')
if [ "$TEST_STATUS" -eq "0" ]; then
echo "All tests passed"
EXIT_CODE=0
else
echo "Some tests failed. Details:"
echo $RESULT | jq '.issues.testFailureSummaries'
EXIT_CODE=1
fi
xcparse logs build/ios/TestResults.xcresult build/ios/TestResults
find build/ios -name StandardOutputAndStandardError.txt -exec cat {} +
exit $EXIT_CODE