2016-07-15 08:31:50 -07:00
|
|
|
// 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.
|
2016-07-12 17:10:48 -07:00
|
|
|
|
|
|
|
namespace Microsoft.DotNet.Cli.Build
|
|
|
|
{
|
2017-01-27 17:13:04 -08:00
|
|
|
public class DotNetTest : DotNetMSBuildTool
|
2016-07-12 17:10:48 -07:00
|
|
|
{
|
|
|
|
protected override string Command
|
|
|
|
{
|
|
|
|
get { return "test"; }
|
|
|
|
}
|
|
|
|
|
|
|
|
protected override string Args
|
|
|
|
{
|
2017-01-27 17:13:04 -08:00
|
|
|
get { return $"{base.Args} {GetProjectPath()} {GetConfiguration()} {GetLogger()} {GetNoBuild()}"; }
|
2016-07-12 17:10:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
public string Configuration { get; set; }
|
|
|
|
|
2016-11-11 21:46:29 -10:00
|
|
|
public string Logger { get; set; }
|
2016-07-12 17:10:48 -07:00
|
|
|
|
2016-11-11 21:46:29 -10:00
|
|
|
public string ProjectPath { get; set; }
|
2016-07-12 17:10:48 -07:00
|
|
|
|
2016-07-15 00:20:23 -07:00
|
|
|
public bool NoBuild { get; set; }
|
|
|
|
|
2016-07-12 17:10:48 -07:00
|
|
|
private string GetConfiguration()
|
|
|
|
{
|
|
|
|
if (!string.IsNullOrEmpty(Configuration))
|
|
|
|
{
|
|
|
|
return $"--configuration {Configuration}";
|
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2016-11-11 21:46:29 -10:00
|
|
|
private string GetLogger()
|
2016-07-12 17:10:48 -07:00
|
|
|
{
|
2016-11-11 21:46:29 -10:00
|
|
|
if (!string.IsNullOrEmpty(Logger))
|
2016-07-12 17:10:48 -07:00
|
|
|
{
|
2016-11-11 21:46:29 -10:00
|
|
|
return $"--logger:{Logger}";
|
2016-07-12 17:10:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2016-11-11 21:46:29 -10:00
|
|
|
private string GetProjectPath()
|
2016-07-12 17:10:48 -07:00
|
|
|
{
|
2016-11-11 21:46:29 -10:00
|
|
|
if (!string.IsNullOrEmpty(ProjectPath))
|
2016-07-12 17:10:48 -07:00
|
|
|
{
|
2016-11-11 21:46:29 -10:00
|
|
|
return $"{ProjectPath}";
|
2016-07-12 17:10:48 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2016-11-11 21:46:29 -10:00
|
|
|
|
2016-07-15 00:20:23 -07:00
|
|
|
private string GetNoBuild()
|
|
|
|
{
|
|
|
|
if (NoBuild)
|
|
|
|
{
|
2016-12-16 20:42:57 +05:30
|
|
|
return "--no-build";
|
2016-07-15 00:20:23 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
return null;
|
|
|
|
}
|
2016-07-12 17:10:48 -07:00
|
|
|
}
|
|
|
|
}
|