Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Xamarin.Android.Build.Tests] Prevent build logs locking up IDEs (#1876)
When running tests in Visual Studio's test runner UI (Windows and macOS), a test failure causes an unpleasant experience: Since the entire MSBuild diagnostic log is contained within a `FailedBuildException`, the UI will hang anywhere from 30 seconds to 1 minute while it tries to render the exception details in the IDE. The solution here is to: - Detect if the unit test is running inside an IDE - Don't include the build log in the exception details in this case On Windows, we can detect the test running by the process name, which is either `testhost.x86` or `testhost.x64`. On macOS, we can detect VS for Mac by looking for the `MONO_GAC_PREFIX` environment variable, which points to `/Applications/Visual Studio.app/Contents/Resources` by default. If neither of these cases are met, such as command line, the exception remains unchanged.
- Loading branch information