Skip to content

Instantly share code, notes, and snippets.

@Geri-Borbas
Last active February 27, 2019 18:21
Show Gist options
  • Save Geri-Borbas/ad4fb8d64bdcb0c50a6abea57716823e to your computer and use it in GitHub Desktop.
Save Geri-Borbas/ad4fb8d64bdcb0c50a6abea57716823e to your computer and use it in GitHub Desktop.
Run Unity Editor Tests from command line. See https://gist.github.com/eppz/e566781bb20abf6df09469515d07ae83 for tasks.json. Don't forget to make it executable using chmod +x.
#!/bin/sh
UNITY_EXECUTABLE="/Applications/Unity/Unity.app/Contents/MacOS/Unity"
PROJECT_FOLDER="$1"
RESULTS_FILENAME="$2"
RESULTS_FILEPATH="$PROJECT_FOLDER/$RESULTS_FILENAME"
echo "Testing Unity project: $PROJECT_FOLDER"
echo "Running Unity.app (batch mode, run tests)..."
time \
"$UNITY_EXECUTABLE" \
-projectPath "$PROJECT_FOLDER" \
-batchmode \
-runEditorTests \
-editorTestsResultFile "$RESULTS_FILEPATH" \
-nographics
echo ""
echo "Editor log: ~/Library/Logs/Unity/Editor.log"
echo "Results xml: $RESULTS_FILEPATH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment