Handling configuration when the env variable is not set.

This commit is contained in:
Livar Cunha 2016-10-14 12:45:04 -07:00
parent 58bc3b5853
commit 8ad1982013
2 changed files with 6 additions and 6 deletions

View file

@ -92,7 +92,8 @@ namespace Microsoft.DotNet.Tests.EndToEnd
var testAppName = "MSBuildTestAppWithToolInDependencies"; var testAppName = "MSBuildTestAppWithToolInDependencies";
var testInstance = TestAssetsManager var testInstance = TestAssetsManager
.CreateTestInstance(testAppName); .CreateTestInstance(testAppName);
var configuration = Environment.GetEnvironmentVariable("Configuration") ?? "Debug";
var configuration = "Debug";
var testProjectDirectory = testInstance.TestRoot; var testProjectDirectory = testInstance.TestRoot;
@ -104,7 +105,7 @@ namespace Microsoft.DotNet.Tests.EndToEnd
new Build3Command() new Build3Command()
.WithWorkingDirectory(testProjectDirectory) .WithWorkingDirectory(testProjectDirectory)
.Execute() .Execute($"-c {configuration}")
.Should() .Should()
.Pass(); .Pass();

View file

@ -26,6 +26,7 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
MSBuildTestProjectInstance = MSBuildTestProjectInstance =
TestAssetsManager.CreateTestInstance("MSBuildTestAppWithToolInDependencies"); TestAssetsManager.CreateTestInstance("MSBuildTestAppWithToolInDependencies");
_repoDirectoriesProvider = new RepoDirectoriesProvider(); _repoDirectoriesProvider = new RepoDirectoriesProvider();
_configuration = "Debug";
new Restore3Command() new Restore3Command()
.WithWorkingDirectory(MSBuildTestProjectInstance.Path) .WithWorkingDirectory(MSBuildTestProjectInstance.Path)
@ -35,12 +36,10 @@ namespace Microsoft.DotNet.Cli.Utils.Tests
new Build3Command() new Build3Command()
.WithWorkingDirectory(MSBuildTestProjectInstance.Path) .WithWorkingDirectory(MSBuildTestProjectInstance.Path)
.Execute() .Execute($"-c {_configuration}")
.Should() .Should()
.Pass(); .Pass();
_configuration = Environment.GetEnvironmentVariable("Configuration") ?? "Debug";
Environment.SetEnvironmentVariable( Environment.SetEnvironmentVariable(
Constants.MSBUILD_EXE_PATH, Constants.MSBUILD_EXE_PATH,
Path.Combine(_repoDirectoriesProvider.Stage2Sdk, "msbuild.exe")); Path.Combine(_repoDirectoriesProvider.Stage2Sdk, "msbuild.exe"));