forked from decentraland/unity-renderer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ci-editmode-test.sh
executable file
·38 lines (31 loc) · 1.08 KB
/
ci-editmode-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
#!/usr/bin/env bash
source ci-setup.sh
echo "Running editmode tests for $PROJECT_PATH"
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' $UNITY_PATH/Editor/Unity \
-batchmode \
-projectPath "$PROJECT_PATH" \
-logFile "$PROJECT_PATH/editmode-logs.txt" \
-runTests \
-testPlatform EditMode \
-testResults "$PROJECT_PATH/editmode-results.xml" \
-enableCodeCoverage \
-coverageResultsPath "$PROJECT_PATH/CodeCoverage" \
-coverageOptions "generateAdditionalMetrics;generateHtmlReport;generateBadgeReport"
# Catch exit code
UNITY_EXIT_CODE=$?
# Print unity log output
ls -la $PROJECT_PATH
find /tmp/workspace/unity-renderer -name editmode-results.xml
find $PROJECT_PATH -name editmode-results.xml
cat "$PROJECT_PATH/editmode-results.xml"
# Display results
if [ $UNITY_EXIT_CODE -eq 0 ]; then
echo "Run succeeded, no failures occurred";
elif [ $UNITY_EXIT_CODE -eq 2 ]; then
echo "Run succeeded, some tests failed";
elif [ $UNITY_EXIT_CODE -eq 3 ]; then
echo "Run failure (other failure)";
else
echo "Unexpected exit code $UNITY_EXIT_CODE";
fi
exit $UNITY_EXIT_CODE