Enable unit tests in build script
This commit is contained in:
Родитель
74ab31b44b
Коммит
ee845b80d7
29
build.cake
29
build.cake
|
@ -1,6 +1,6 @@
|
||||||
#tool nuget:?package=GitVersion.CommandLine
|
#tool nuget:?package=GitVersion.CommandLine
|
||||||
#tool nuget:?package=vswhere
|
#tool nuget:?package=vswhere
|
||||||
#tool nuget:?package=NUnit.ConsoleRunner
|
#tool nuget:?package=xunit.runner.console
|
||||||
#addin nuget:?package=Cake.Incubator&version=1.6.0
|
#addin nuget:?package=Cake.Incubator&version=1.6.0
|
||||||
#addin nuget:?package=Cake.Git&version=0.16.0
|
#addin nuget:?package=Cake.Git&version=0.16.0
|
||||||
#addin nuget:?package=Polly
|
#addin nuget:?package=Polly
|
||||||
|
@ -87,29 +87,22 @@ Task("UnitTest")
|
||||||
.IsDependentOn("Build")
|
.IsDependentOn("Build")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
{
|
{
|
||||||
var testPaths = new List<FilePath> {
|
var testPaths = GetFiles("./MvvmCross.Tests/*.UnitTest/bin/Release/netcoreapp2.0/*.UnitTest.dll");
|
||||||
new FilePath("./MvvmCross.Tests/MvvmCross.Tests/bin/Release/netcoreapp2.0/MvvmCross.Tests.dll"),
|
|
||||||
new FilePath("./MvvmCross.Tests/Plugins.Color.Test/bin/Release/netcoreapp2.0/MvvmCross.Plugins.Color.Tests.dll"),
|
|
||||||
new FilePath("./MvvmCross.Tests/Plugins.JsonLocalization.Tests/bin/Release/netcoreapp2.0/MvvmCross.Plugins.JsonLocalization.Tests.dll"),
|
|
||||||
new FilePath("./MvvmCross.Tests/Plugins.Messenger.Test/bin/Release/netcoreapp2.0/MvvmCross.Plugins.Messenger.Tests.dll"),
|
|
||||||
new FilePath("./MvvmCross.Tests/Plugins.Network.Test/bin/Release/netcoreapp2.0/MvvmCross.Plugins.Network.Tests.dll"),
|
|
||||||
//new FilePath("./MvvmCross.Tests/Plugins.ResourceLoader.Test/bin/Release/netcoreapp2.0/MvvmCross.Plugins.ResourceLoader.Tests.dll"),
|
|
||||||
new FilePath("./MvvmCross.Tests/Plugins.ResxLocalization.Tests/bin/Release/netcoreapp2.0/MvvmCross.Plugins.ResxLocalization.Tests.dll")
|
|
||||||
};
|
|
||||||
|
|
||||||
var testResultsPath = new DirectoryPath(outputDir + "/Tests/");
|
var testResultsPath = new DirectoryPath(outputDir + "/Tests/");
|
||||||
var outputPath = new FilePath(outputDir + "/NUnitOutput.txt");
|
|
||||||
|
|
||||||
NUnit3(testPaths, new NUnit3Settings {
|
var testSettings = new XUnit2Settings
|
||||||
Timeout = 30000,
|
{
|
||||||
OutputFile = outputPath,
|
XmlReport = true,
|
||||||
Work = testResultsPath
|
OutputDirectory = testResultsPath
|
||||||
});
|
};
|
||||||
|
|
||||||
|
XUnit2(testPaths, testSettings);
|
||||||
|
|
||||||
if (isRunningOnAppVeyor)
|
if (isRunningOnAppVeyor)
|
||||||
{
|
{
|
||||||
foreach(var testResult in GetFiles(outputDir + "/Tests/*.xml"))
|
foreach(var testResult in GetFiles(outputDir + "/Tests/*.xml"))
|
||||||
AppVeyor.UploadTestResults(testResult, AppVeyorTestResultsType.NUnit3);
|
AppVeyor.UploadTestResults(testResult, AppVeyorTestResultsType.XUnit);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -175,7 +168,7 @@ Task("UploadAppVeyorArtifact")
|
||||||
|
|
||||||
Task("Default")
|
Task("Default")
|
||||||
.IsDependentOn("Build")
|
.IsDependentOn("Build")
|
||||||
//.IsDependentOn("UnitTest")
|
.IsDependentOn("UnitTest")
|
||||||
.IsDependentOn("PublishPackages")
|
.IsDependentOn("PublishPackages")
|
||||||
.IsDependentOn("UploadAppVeyorArtifact")
|
.IsDependentOn("UploadAppVeyorArtifact")
|
||||||
.Does(() =>
|
.Does(() =>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче