Find dotnet under tests from the dotnet executing the test

This commit is contained in:
Piotr Puszkiewicz 2017-03-09 13:31:04 -08:00
parent 3a58cac351
commit f6f43f6aa2
2 changed files with 29 additions and 2 deletions

View file

@ -1,7 +1,6 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
@ -9,7 +8,7 @@ namespace Microsoft.DotNet.Tools.Test.Utilities
public sealed class DotnetCommand : TestCommand
{
public DotnetCommand()
: base("dotnet")
: base(DotnetUnderTest.FullName)
{
}

View file

@ -0,0 +1,28 @@
// Copyright (c) .NET Foundation and contributors. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
using System;
using Microsoft.DotNet.Cli.Utils;
namespace Microsoft.DotNet.Tools.Test.Utilities
{
public static class DotnetUnderTest
{
static string _pathToDotnetUnderTest;
public static string FullName
{
get
{
if (_pathToDotnetUnderTest == null)
{
_pathToDotnetUnderTest = new Muxer().MuxerPath;
}
Console.WriteLine($"Executing tests against {_pathToDotnetUnderTest}");
return _pathToDotnetUnderTest;
}
}
}
}