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