diff --git a/GitVersion.yml b/GitVersion.yml index 3b27dee15..e4a74f1aa 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -6,7 +6,7 @@ commits-since-version-source-padding: 5 branches: master: regex: ^(main|version4)$ - tag: dev + tag: alpha release: tag: pre pull-request: diff --git a/README.md b/README.md index a4f0bfa65..63a587c6e 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# NUnit 3 Console and Engine # +# NUnit 3 Console and Engine [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/81uhucr7tlq2kwup/branch/master?svg=true)](https://ci.appveyor.com/project/CharliePoole/nunit-console/branch/master) [![Azure Pipelines Build Status](https://nunit.visualstudio.com/NUnit/_apis/build/status/NUnit%20Engine%20&%20Console/NUnit%20Console%20CI?branchName=master)](https://nunit.visualstudio.com/NUnit/_build/latest?definitionId=13&branchName=master) [![NuGet Version and Downloads count](https://buildstats.info/nuget/NUnit.ConsoleRunner)](https://www.nuget.org/packages/NUnit.ConsoleRunner) @@ -6,7 +6,7 @@ NUnit is a unit-testing framework for all .NET languages. Initially ported from JUnit, the current production release, version 3, has been completely rewritten with many new features and support for a wide range of .NET platforms. -## Table of Contents ## +## Table of Contents - [Downloads](#downloads) - [Documentation](#documentation) @@ -14,7 +14,7 @@ NUnit is a unit-testing framework for all .NET languages. Initially ported from - [License](#license) - [NUnit Projects](#nunit-projects) -## Downloads ## +## Downloads The latest stable release of the NUnit Console is [available on NuGet](https://www.nuget.org/packages/NUnit.ConsoleRunner/), [Chocolatey](https://chocolatey.org/packages/nunit-console-runner), or can be [downloaded from GitHub](https://github.com/nunit/nunit-console/releases). Pre-release builds are [available on MyGet](https://www.myget.org/feed/nunit/package/nuget/NUnit.ConsoleRunner). @@ -25,11 +25,11 @@ The Console/Engine are available in various packages: - [NUnit.Engine](https://www.nuget.org/packages/NUnit.Engine/) & [NUnit.Engine.Api](https://www.nuget.org/packages/NUnit.Engine.Api/): Packages intended for custom runners integrating directly with the NUnit Engine. Development builds of all packages are available from our MyGet feed at https://www.myget.org/feed/Packages/nunit -## Documentation ## +## Documentation Documentation for all NUnit projects are available at [https://docs.nunit.org/](https://docs.nunit.org/). -## Contributing ## +## Contributing For more information on contributing to the NUnit project, please see [CONTRIBUTING.md](https://github.com/nunit/nunit-console/blob/master/CONTRIBUTING.md) and the [Developer Docs](https://github.com/nunit/docs/wiki/Team-Practices#technical-practices). @@ -37,31 +37,31 @@ NUnit 3.0 was created by [Charlie Poole](https://github.com/CharliePoole), [Rob Earlier versions of NUnit were developed by Charlie Poole, James W. Newkirk, Alexei A. Vorontsov, Michael C. Two and Philip A. Craig. -## License ## +## License NUnit is Open Source software and NUnit 3 is released under the [MIT license](https://github.com/nunit/docs/wiki/License). Earlier releases used the [NUnit license](http://www.nunit.org/nuget/license.html). Both of these licenses allow the use of NUnit in free and commercial applications and libraries without restrictions. -## NUnit Projects ## +## NUnit Projects NUnit is made up of several projects. When reporting issues, please try to report issues in the correct project. -### Core Projects ### +### Core Projects - [NUnit Test Framework](https://github.com/nunit/nunit) - The test framework used to write NUnit tests - [NUnit Console and Engine](https://github.com/nunit/nunit-console) - Runs unit tests from the command line and provides the engine that is used by other test runners to run NUnit tests -### Visual Studio Extensions ### +### Visual Studio Extensions - [NUnit 3 Visual Studio Adapter](https://github.com/nunit/nunit3-vs-adapter) - Visual Studio adapter for running NUnit 3 tests in Visual Studio and in VSTS/TFS builds - [NUnit Visual Studio Templates](https://github.com/nunit/nunit-vs-templates) - Project templates and snippets for writing unit tests in Visual Studio - [Visual Studio Test Generator](https://github.com/nunit/nunit-vs-testgenerator) - Generates NUnit tests in Visual Studio - [NUnit 2 Visual Studio Adapter](https://github.com/nunit/nunit-vs-adapter) - Visual Studio adapter for running older NUnit 2.x tests in Visual Studio and in VSTS/TFS builds -### Other Projects ### +### Other Projects - [NUnit Xamarin Runner](https://github.com/nunit/nunit.xamarin) - Runs NUnit 3 tests on mobile devices using the Xamarin framework -### NUnit Engine Extensions ### +### NUnit Engine Extensions - [NUnit 2 Driver](https://github.com/nunit/nunit-v2-framework-driver) - Allows the NUnit 3 engine to run NUnit 2 tests - [NUnit 2 Result Writer](https://github.com/nunit/nunit-v2-result-writer) - Writes test results in the legacy NUnit 2 format diff --git a/build.cake b/build.cake index 9dfb9e07e..9f39ad7a0 100644 --- a/build.cake +++ b/build.cake @@ -1,5 +1,5 @@ // Load the recipe -#load nuget:?package=NUnit.Cake.Recipe&version=1.2.1-dev00002 +#load nuget:?package=NUnit.Cake.Recipe&version=1.3.0-alpha.1 // Comment out above line and uncomment below for local tests of recipe changes //#load ../NUnit.Cake.Recipe/recipe/*.cake @@ -92,7 +92,7 @@ BuildSettings.Packages.AddRange(new PackageDefinition[] { checks: new PackageCheck[] { HasFiles("nunit.exe"), - HasSomeDirectory(".store/nunit.consolerunner.netcore/**/tools/net8.0/any") + HasDirectory(".store/nunit.consolerunner.netcore/**/tools/net8.0/any") .WithFiles(ENGINE_FILES).AndFiles(ConsoleFiles).AndFile("Microsoft.Extensions.DependencyModel.dll") }, testRunner: new ConsoleRunnerSelfTester(BuildSettings.NuGetTestDirectory @@ -205,68 +205,6 @@ Task("TestNetCorePackage") NUnitConsoleRunnerNetCorePackage.RunPackageTests(); }); -// Adhoc code to check content of a dotnet standalone executable -// TODO: Incorporate this in the recipe itself - -private static ExtendedDirectoryCheck HasSomeDirectory(string pattern) => new ExtendedDirectoryCheck(pattern); - -public class ExtendedDirectoryCheck : PackageCheck -{ - private string _directoryPattern; - private List _files = new List(); - - public ExtendedDirectoryCheck(string directoryPattern) - { - // Assume it has no wildcard - checked in ApplyTo method - _directoryPattern = directoryPattern; - } - - public ExtendedDirectoryCheck WithFiles(params FilePath[] files) - { - _files.AddRange(files); - return this; - } - - public ExtendedDirectoryCheck AndFiles(params FilePath[] files) - { - return WithFiles(files); - } - - public ExtendedDirectoryCheck WithFile(FilePath file) - { - _files.Add(file); - return this; - } - - public ExtendedDirectoryCheck AndFile(FilePath file) - { - return AndFiles(file); - } - - public override bool ApplyTo(DirectoryPath testDirPath) - { - if (_directoryPattern.Contains('*') || _directoryPattern.Contains('?')) // Wildcard - { - var absDirPattern = testDirPath.Combine(_directoryPattern).ToString(); - foreach (var dir in _context.GetDirectories(absDirPattern)) - { - // Use first one found - return CheckFilesExist(_files.Select(file => dir.CombineWithFilePath(file))); - } - } - else // No wildcard - { - var absDirPath = testDirPath.Combine(_directoryPattern); - if (!CheckDirectoryExists(absDirPath)) - return false; - - return CheckFilesExist(_files.Select(file => absDirPath.CombineWithFilePath(file))); - } - - return false; - } -} - ////////////////////////////////////////////////////////////////////// // TEST RUNNERS ////////////////////////////////////////////////////////////////////// @@ -288,65 +226,6 @@ public class ConsoleRunnerSelfTester : TestRunner, IPackageTestRunner } } -////////////////////////////////////////////////////////////////////// -// ADDITIONAL TARGETS USED FOR RECOVERY AND DEBUGGING -////////////////////////////////////////////////////////////////////// - -// Some of these targets may be moved into the recipe itself in the future. - -// When a NuGet package was published successfully but the corresponding symbols -// package failed, use this target locally after correcting the error. -// TODO: This task is extemely complicated because it has to copy lots of code -// from the recipe. It would be simpler if it were integrated in the recipe. -// TODO: This has been tested on NUnit.ConsoleRunner, so the branches with either -// zero or one packages are speculative at this point. They will need testing -// if this is incorporated into the recipe. -Task("PublishSymbolsPackage") - .Description("Re-publish a specific symbols package to NuGet after a failure") - .Does(() => - { - if (!BuildSettings.ShouldPublishToNuGet) - Information("Nothing to publish to NuGet from this run."); - else if (CommandLineOptions.NoPush) - Information("NoPush option suppressing publication to NuGet"); - else - { - List packages; - - if (BuildSettings.Packages.Count == 0) - throw new Exception("No packages exist!"); - else if (BuildSettings.Packages.Count == 1) - { - if (BuildSettings.Packages[0].PackageType != PackageType.NuGet) - throw new Exception("The only package is not a NuGet package"); - - packages = BuildSettings.Packages; - } - else // count is > 1 - { - if (!CommandLineOptions.PackageSelector.Exists) - throw new Exception("Multiple packages exist. Specify a nuget package id using the '--where' option"); - - packages = new List(); - - foreach (var package in BuildSettings.Packages) - if (package.IsSelectedBy(CommandLineOptions.PackageSelector.Value)) - packages.Add(package); - - if (packages.Count > 1) - throw new Exception("The '--where' option selected multiple packages"); - - if (packages[0].PackageType != PackageType.NuGet) - throw new Exception("The selected package is a {package.PackageType} package. It must be a package for nuget.org."); - } - - // At this point we have a single NuGet package in packages - var packageName = $"{packages[0].PackageId}.{BuildSettings.PackageVersion}.snupkg"; - var packagePath = BuildSettings.PackageDirectory + packageName; - NuGetPush(packagePath, new NuGetPushSettings() { ApiKey = BuildSettings.NuGetApiKey, Source = BuildSettings.NuGetPushUrl }); - } - }); - ////////////////////////////////////////////////////////////////////// // EXECUTION //////////////////////////////////////////////////////////////////////