diff --git a/dist/steps/run_tests.ps1 b/dist/steps/run_tests.ps1 index baacb64..11f2a40 100644 --- a/dist/steps/run_tests.ps1 +++ b/dist/steps/run_tests.ps1 @@ -116,6 +116,9 @@ foreach ( $platform in ${env:TEST_PLATFORMS}.Split(";") ) if ( ( $TEST_EXIT_CODE -eq 0 ) -and ( "$platform" -eq "standalone" ) ) { + # Code Coverage currently only supports code ran in the Editor and not in Standalone/Player. + # https://docs.unity.cn/Packages/com.unity.testtools.codecoverage@1.1/manual/TechnicalDetails.html#how-it-works + $TEST_OUTPUT = Start-Process -NoNewWindow -Wait -PassThru "$UNITY_PROJECT_PATH\Build\UnityTestRunner-Standalone.exe" -ArgumentList "-batchmode -nographics -logFile $FULL_ARTIFACTS_PATH\$platform-player.log -testResults $FULL_ARTIFACTS_PATH\$platform-results.xml" # Catch exit code diff --git a/dist/steps/run_tests.sh b/dist/steps/run_tests.sh index 0d98fa9..3da9448 100755 --- a/dist/steps/run_tests.sh +++ b/dist/steps/run_tests.sh @@ -115,7 +115,9 @@ for platform in ${TEST_PLATFORMS//;/ }; do echo "###########################" echo "" - # Not sure how to get code coverage with this method. + # Code Coverage currently only supports code ran in the Editor and not in Standalone/Player. + # https://docs.unity.cn/Packages/com.unity.testtools.codecoverage@1.1/manual/TechnicalDetails.html#how-it-works + xvfb-run -a -e /dev/stdout "$UNITY_PROJECT_PATH/Build/UnityTestRunner-Standalone" \ -batchmode \ -nographics \