parent
770026eef7
commit
78cef18e1c
22 changed files with 378 additions and 102 deletions
|
@ -40,10 +40,20 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
|
|||
|
||||
public virtual void Dispose()
|
||||
{
|
||||
if (_temp != null)
|
||||
{
|
||||
if (_temp != null && !PreserveTemp())
|
||||
{
|
||||
_temp.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
// Quick-n-dirty way to allow the temp output to be preserved when running tests
|
||||
private bool PreserveTemp()
|
||||
{
|
||||
var val = Environment.GetEnvironmentVariable("DOTNET_TEST_PRESERVE_TEMP");
|
||||
return !string.IsNullOrEmpty(val) && (
|
||||
string.Equals("true", val, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals("1", val, StringComparison.OrdinalIgnoreCase) ||
|
||||
string.Equals("on", val, StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue