Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(GH-312) Updated unit test checks to correctly identify unit test library #365

Merged
merged 4 commits into from
Sep 3, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Cake.Recipe/Content/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -341,35 +341,35 @@ public void CopyBuildOutput()
Information("Is a .Net Core Build");
}

if(parsedProject.IsLibrary() && parsedProject.IsXUnitTestProject())
if(parsedProject.IsLibrary() && (parsedProject.HasPackage("xunit") || parsedProject.HasReference("xunit.core")))
{
Information("Project has an output type of library and is an xUnit Test Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedxUnitTests.Combine(parsedProject.RootNameSpace);
EnsureDirectoryExists(outputFolder);
CopyFiles(GetFiles(parsedProject.OutputPath.FullPath + "/**/*"), outputFolder, true);
continue;
}
else if(parsedProject.IsLibrary() && parsedProject.IsMSTestProject())
else if(parsedProject.IsLibrary() && (parsedProject.HasPackage("fixie") || parsedProject.HasReference("fixie")))
{
// We will use vstest.console.exe by default for MSTest Projects
Information("Project has an output type of library and is an MSTest Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedVSTestTests.Combine(parsedProject.RootNameSpace);
Information("Project has an output type of library and is a Fixie Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedFixieTests.Combine(parsedProject.RootNameSpace);
EnsureDirectoryExists(outputFolder);
CopyFiles(GetFiles(parsedProject.OutputPath.FullPath + "/**/*"), outputFolder, true);
continue;
}
else if(parsedProject.IsLibrary() && parsedProject.IsFixieTestProject())
else if(parsedProject.IsLibrary() && (parsedProject.HasPackage("nunit") || parsedProject.HasReference("nunit.framework")))
{
Information("Project has an output type of library and is a Fixie Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedFixieTests.Combine(parsedProject.RootNameSpace);
Information("Project has an output type of library and is a NUnit Test Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedNUnitTests.Combine(parsedProject.RootNameSpace);
EnsureDirectoryExists(outputFolder);
CopyFiles(GetFiles(parsedProject.OutputPath.FullPath + "/**/*"), outputFolder, true);
continue;
}
else if(parsedProject.IsLibrary() && parsedProject.IsNUnitTestProject())
else if(parsedProject.IsLibrary() && parsedProject.IsMSTestProject())
{
Information("Project has an output type of library and is a NUnit Test Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedNUnitTests.Combine(parsedProject.RootNameSpace);
// We will use vstest.console.exe by default for MSTest Projects
Information("Project has an output type of library and is an MSTest Project: {0}", parsedProject.RootNameSpace);
var outputFolder = BuildParameters.Paths.Directories.PublishedVSTestTests.Combine(parsedProject.RootNameSpace);
EnsureDirectoryExists(outputFolder);
CopyFiles(GetFiles(parsedProject.OutputPath.FullPath + "/**/*"), outputFolder, true);
continue;
Expand Down