From 2281a78141d0eea1604fe956927ae93eeccf675e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mille=20Bostr=C3=B6m?= Date: Mon, 10 Feb 2020 08:47:13 +0100 Subject: [PATCH] Release 1.5.0 (#29) - Removed BuildSolution config value - Updated Microsoft.CodeAnalysis to 3.4.0 - Changed from MsBuilderWorkspace to AdhocWorkspace for console --- .../CreateMutationsCommandHandler.cs | 2 +- .../Handlers/OpenProjectBuildHandler.cs | 30 --- .../Handlers/OpenProjectWorkspaceHandler.cs | 18 +- .../OpenProject/OpenProjectCommandHandler.cs | 2 - .../Models/MutationFileConfig.cs | 3 - .../Testura.Mutation.Application.csproj | 174 ++++++++++++++---- src/Testura.Mutation.Application/app.config | 34 +++- .../packages.config | 65 +++++-- src/Testura.Mutation.Console/App.config | 48 ++++- .../Commands/MutateLocalCommand.cs | 2 - .../Properties/AssemblyInfo.cs | 4 +- .../Testura.Mutation.Console.csproj | 155 +++++++++++----- src/Testura.Mutation.Console/packages.config | 61 ++++-- .../Baseline/BaselineCreator.cs | 9 +- .../Config/MutationConfig.cs | 4 +- .../Creator/MutationDocumentCreator.cs | 7 +- .../Execution/Compilation/Compiler.cs | 10 + .../Solution/ISolutionOpener.cs | 5 +- .../Solution/MsBuildSolutionOpener.cs | 70 +++---- .../Solution/VisualStudioSolutionOpener.cs | 11 +- .../Testura.Mutation.Core.csproj | 15 +- .../Properties/AssemblyInfo.cs | 4 +- .../Config/MutationConfigWindowControl.xaml | 11 -- .../Config/MutationConfigWindowViewModel.cs | 4 - .../Testura.Mutation.VsExtension.csproj | 2 +- .../TesturaMutationVsExtensionPackage.cs | 2 +- .../source.extension.vsixmanifest | 2 +- src/Testura.Mutation.Wpf.Shared/app.config | 34 +++- .../Testura.Mutation.Wpf.csproj | 3 - .../Testura.Mutation.Tests.csproj | 28 +-- tests/Testura.Mutation.Tests/packages.config | 16 +- 31 files changed, 548 insertions(+), 287 deletions(-) delete mode 100644 src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectBuildHandler.cs diff --git a/src/Testura.Mutation.Application/Commands/Mutation/CreateMutations/CreateMutationsCommandHandler.cs b/src/Testura.Mutation.Application/Commands/Mutation/CreateMutations/CreateMutationsCommandHandler.cs index 2605888..a2e11a0 100644 --- a/src/Testura.Mutation.Application/Commands/Mutation/CreateMutations/CreateMutationsCommandHandler.cs +++ b/src/Testura.Mutation.Application/Commands/Mutation/CreateMutations/CreateMutationsCommandHandler.cs @@ -18,7 +18,7 @@ public CreateMutationsCommandHandler(MutationDocumentCreator mutationsCreator) public Task> Handle(CreateMutationsCommand command, CancellationToken cancellationToken) { - return _mutationsCreator.CreateMutationsAsync(command.Config, cancellationToken); + return Task.FromResult(_mutationsCreator.CreateMutations(command.Config, cancellationToken)); } } } diff --git a/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectBuildHandler.cs b/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectBuildHandler.cs deleted file mode 100644 index d0f7859..0000000 --- a/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectBuildHandler.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; -using Testura.Mutation.Application.Models; -using Testura.Mutation.Core.Config; -using Testura.Mutation.Core.Solution; - -namespace Testura.Mutation.Application.Commands.Project.OpenProject.Handlers -{ - public class OpenProjectBuildHandler : OpenProjectHandler - { - private readonly ISolutionBuilder _solutionBuilder; - - public OpenProjectBuildHandler(ISolutionBuilder solutionBuilder) - { - _solutionBuilder = solutionBuilder; - } - - public override Task HandleAsync(MutationFileConfig fileConfig, MutationConfig applicationConfig, CancellationToken cancellationToken = default(CancellationToken)) - { - cancellationToken.ThrowIfCancellationRequested(); - - if (fileConfig.BuildSolution) - { - _solutionBuilder.BuildSolution(fileConfig.SolutionPath); - } - - return base.HandleAsync(fileConfig, applicationConfig, cancellationToken); - } - } -} diff --git a/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectWorkspaceHandler.cs b/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectWorkspaceHandler.cs index 14fc303..8a3f881 100644 --- a/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectWorkspaceHandler.cs +++ b/src/Testura.Mutation.Application/Commands/Project/OpenProject/Handlers/OpenProjectWorkspaceHandler.cs @@ -31,20 +31,20 @@ public OpenProjectWorkspaceHandler(BaselineCreator baselineCreator, ISolutionOpe { cancellationToken.ThrowIfCancellationRequested(); - var solution = await _solutionOpener.GetSolutionAsync(applicationConfig); + applicationConfig.Solution = await _solutionOpener.GetSolutionAsync(fileConfig.SolutionPath); - InitializeTestProjects(fileConfig, applicationConfig, solution); - InitializeMutationProjects(fileConfig, applicationConfig, solution); + InitializeTestProjects(fileConfig, applicationConfig); + InitializeMutationProjects(fileConfig, applicationConfig); if (fileConfig.CreateBaseline) { - applicationConfig.BaselineInfos = new List(await _baselineCreator.CreateBaselineAsync(applicationConfig, solution, cancellationToken)); + applicationConfig.BaselineInfos = new List(await _baselineCreator.CreateBaselineAsync(applicationConfig, cancellationToken)); } await base.HandleAsync(fileConfig, applicationConfig, cancellationToken); } - private void InitializeMutationProjects(MutationFileConfig fileConfig, MutationConfig config, Microsoft.CodeAnalysis.Solution solution) + private void InitializeMutationProjects(MutationFileConfig fileConfig, MutationConfig config) { if (fileConfig.IgnoredProjects == null) { @@ -52,7 +52,7 @@ private void InitializeMutationProjects(MutationFileConfig fileConfig, MutationC } LogTo.Info("Setting up mutation projects."); - foreach (var solutionProject in solution.Projects) + foreach (var solutionProject in config.Solution.Projects) { if ( IsIgnored(solutionProject.Name, fileConfig.IgnoredProjects) || @@ -88,7 +88,7 @@ private bool WeTargetSpecificFrameworkThatThisProjectDontSupport(string projectF return !content.ToLower().Contains(targetFramework.Name.ToLower()); } - private void InitializeTestProjects(MutationFileConfig fileConfig, MutationConfig config, Solution solution) + private void InitializeTestProjects(MutationFileConfig fileConfig, MutationConfig config) { if (fileConfig.TestProjects == null || !fileConfig.TestProjects.Any()) { @@ -99,11 +99,11 @@ private void InitializeTestProjects(MutationFileConfig fileConfig, MutationConfi LogTo.Info("Setting up test projects."); foreach (var testProjectName in fileConfig.TestProjects) { - var testProjects = solution.Projects.Where(p => Regex.IsMatch(p.Name, FormattedProjectName(testProjectName), RegexOptions.IgnoreCase)); + var testProjects = config.Solution.Projects.Where(p => Regex.IsMatch(p.Name, FormattedProjectName(testProjectName), RegexOptions.IgnoreCase)); if (!testProjects.Any()) { - throw new ProjectSetUpException($"Could not find any project with the name {testProjectName} in the solution. List of project names: {string.Join(", ", solution.Projects.Select(p => p.Name))}"); + throw new ProjectSetUpException($"Could not find any project with the name {testProjectName} in the solution. List of project names: {string.Join(", ", config.Solution.Projects.Select(p => p.Name))}"); } foreach (var testProject in testProjects) diff --git a/src/Testura.Mutation.Application/Commands/Project/OpenProject/OpenProjectCommandHandler.cs b/src/Testura.Mutation.Application/Commands/Project/OpenProject/OpenProjectCommandHandler.cs index bd9cdd4..f343eaf 100644 --- a/src/Testura.Mutation.Application/Commands/Project/OpenProject/OpenProjectCommandHandler.cs +++ b/src/Testura.Mutation.Application/Commands/Project/OpenProject/OpenProjectCommandHandler.cs @@ -51,7 +51,6 @@ public async Task Handle(OpenProjectCommand command, Cancellatio var handler = new OpenProjectExistHandler(_gitCloner); handler - .SetNext(new OpenProjectBuildHandler(_solutionBuilder)) .SetNext(new OpenProjectMutatorsHandler()) .SetNext(new OpenProjectGitFilterHandler(_diffCreator)) .SetNext(new OpenProjectWorkspaceHandler(_baselineCreator, _solutionOpener)); @@ -92,7 +91,6 @@ public async Task Handle(OpenProjectCommand command, Cancellatio var config = new MutationConfig { - SolutionPath = fileConfig.SolutionPath, Filter = fileConfig.Filter, NumberOfTestRunInstances = fileConfig.NumberOfTestRunInstances, BuildConfiguration = fileConfig.BuildConfiguration, diff --git a/src/Testura.Mutation.Application/Models/MutationFileConfig.cs b/src/Testura.Mutation.Application/Models/MutationFileConfig.cs index 5892053..74fee0a 100644 --- a/src/Testura.Mutation.Application/Models/MutationFileConfig.cs +++ b/src/Testura.Mutation.Application/Models/MutationFileConfig.cs @@ -15,7 +15,6 @@ public MutationFileConfig() CreateBaseline = true; Mutators = new List(); Filter = new MutationDocumentFilter(); - BuildSolution = true; ProjectMappings = new List(); } @@ -48,7 +47,5 @@ public MutationFileConfig() public TargetFramework TargetFramework { get; set; } public bool CreateBaseline { get; set; } - - public bool BuildSolution { get; set; } } } diff --git a/src/Testura.Mutation.Application/Testura.Mutation.Application.csproj b/src/Testura.Mutation.Application/Testura.Mutation.Application.csproj index f3a6401..2f85089 100644 --- a/src/Testura.Mutation.Application/Testura.Mutation.Application.csproj +++ b/src/Testura.Mutation.Application/Testura.Mutation.Application.csproj @@ -1,7 +1,6 @@  - @@ -41,6 +40,15 @@ ..\..\packages\Anotar.Log4Net.Fody.5.1.0\lib\net452\Anotar.Log4Net.dll + + ..\..\packages\Buildalyzer.2.5.0\lib\netstandard2.0\Buildalyzer.dll + + + ..\..\packages\Buildalyzer.Logger.2.5.0\lib\netstandard1.3\Buildalyzer.Logger.dll + + + ..\..\packages\Buildalyzer.Workspaces.2.5.0\lib\netstandard2.0\Buildalyzer.Workspaces.dll + ..\..\packages\FluentValidation.7.6.105\lib\net45\FluentValidation.dll @@ -50,42 +58,81 @@ ..\..\packages\MediatR.7.0.0\lib\net461\MediatR.dll - - ..\..\packages\Microsoft.Build.Locator.1.2.6\lib\net46\Microsoft.Build.Locator.dll + + ..\..\packages\Microsoft.Build.15.8.166\lib\net46\Microsoft.Build.dll + + + ..\..\packages\Microsoft.Build.Framework.15.8.166\lib\net46\Microsoft.Build.Framework.dll + + + ..\..\packages\Microsoft.Build.Tasks.Core.15.8.166\lib\net46\Microsoft.Build.Tasks.Core.dll + + + ..\..\packages\Microsoft.Build.Utilities.Core.15.8.166\lib\net46\Microsoft.Build.Utilities.Core.dll - - ..\..\packages\Microsoft.CodeAnalysis.Common.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.dll + + ..\..\packages\Microsoft.CodeAnalysis.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.dll - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.3.3.1\lib\net472\Microsoft.CodeAnalysis.EditorFeatures.Text.dll + + ..\..\packages\Microsoft.CodeAnalysis.EditorFeatures.Text.3.4.0\lib\net472\Microsoft.CodeAnalysis.EditorFeatures.Text.dll - - ..\..\packages\Microsoft.CodeAnalysis.Features.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.Features.dll + + ..\..\packages\Microsoft.CodeAnalysis.Features.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.Features.dll - ..\..\packages\Microsoft.CodeAnalysis.FlowAnalysis.Utilities.2.9.5\lib\netstandard1.3\Microsoft.CodeAnalysis.FlowAnalysis.Utilities.dll + ..\..\packages\Microsoft.CodeAnalysis.FlowAnalysis.Utilities.2.9.6\lib\netstandard1.3\Microsoft.CodeAnalysis.FlowAnalysis.Utilities.dll - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll + + ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.MSBuild.3.3.1\lib\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.MSBuild.3.4.0\lib\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.dll ..\..\packages\Microsoft.DiaSymReader.1.3.0\lib\net20\Microsoft.DiaSymReader.dll + + ..\..\packages\Microsoft.DotNet.PlatformAbstractions.2.1.0\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Configuration.Binder.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll + + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll + + + ..\..\packages\Microsoft.Extensions.Logging.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.dll + + + ..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + + ..\..\packages\Microsoft.Extensions.Options.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Options.dll + + + ..\..\packages\Microsoft.Extensions.Primitives.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll + ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll @@ -101,8 +148,12 @@ ..\..\packages\Microsoft.VisualStudio.Composition.15.5.23\lib\net45\Microsoft.VisualStudio.Composition.dll - - ..\..\packages\Microsoft.VisualStudio.LanguageServices.3.3.1\lib\net472\Microsoft.VisualStudio.LanguageServices.dll + + ..\..\packages\Microsoft.VisualStudio.LanguageServices.3.4.0\lib\net472\Microsoft.VisualStudio.LanguageServices.dll + + + ..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.16.30\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll + True ..\..\packages\Microsoft.VisualStudio.Threading.16.3.13\lib\net472\Microsoft.VisualStudio.Threading.dll @@ -110,13 +161,24 @@ ..\..\packages\Microsoft.VisualStudio.Validation.15.3.15\lib\net45\Microsoft.VisualStudio.Validation.dll - + + ..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + ..\..\packages\Microsoft.Win32.Registry.4.5.0\lib\net461\Microsoft.Win32.Registry.dll + + ..\..\packages\Buildalyzer.Logger.2.5.0\lib\netstandard1.3\MsBuildPipeLogger.Logger.dll + + + ..\..\packages\MsBuildPipeLogger.Server.1.1.2\lib\netstandard1.5\MsBuildPipeLogger.Server.dll + ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll + ..\..\packages\SQLitePCLRaw.bundle_green.1.1.2\lib\net45\SQLitePCLRaw.batteries_green.dll @@ -130,6 +192,9 @@ ..\..\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.2\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll + + ..\..\packages\MSBuild.StructuredLogger.2.0.11\lib\net46\StructuredLogger.dll + ..\..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll @@ -179,6 +244,9 @@ + + ..\..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + ..\..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll True @@ -189,9 +257,17 @@ True True - + + ..\..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll + True + True + - + + ..\..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + True + True + ..\..\packages\System.IO.4.3.0\lib\net462\System.IO.dll True @@ -202,7 +278,12 @@ True True - + + + ..\..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + True + True + ..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll True @@ -227,7 +308,16 @@ ..\..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll - + + ..\..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + True + True + + + ..\..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + True + True + @@ -241,6 +331,9 @@ ..\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll + + ..\..\packages\System.Reflection.TypeExtensions.4.6.0\lib\net461\System.Reflection.TypeExtensions.dll + ..\..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll True @@ -259,7 +352,11 @@ True True - + + ..\..\packages\System.Runtime.InteropServices.RuntimeInformation.4.3.0\lib\net45\System.Runtime.InteropServices.RuntimeInformation.dll + True + True + @@ -295,9 +392,13 @@ ..\..\packages\System.Text.Encoding.CodePages.4.5.1\lib\net461\System.Text.Encoding.CodePages.dll - - - ..\..\packages\System.Threading.Tasks.Dataflow.4.5.24\lib\portable-net45+win8+wpa81\System.Threading.Tasks.Dataflow.dll + + ..\..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll + True + True + + + ..\..\packages\System.Threading.Tasks.Dataflow.4.9.0\lib\netstandard2.0\System.Threading.Tasks.Dataflow.dll ..\..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll @@ -312,11 +413,11 @@ ..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + - ..\..\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll @@ -338,6 +439,7 @@ True True + @@ -367,7 +469,6 @@ - @@ -421,14 +522,11 @@ - - - diff --git a/src/Testura.Mutation.Application/app.config b/src/Testura.Mutation.Application/app.config index 64329c6..4c18abc 100644 --- a/src/Testura.Mutation.Application/app.config +++ b/src/Testura.Mutation.Application/app.config @@ -44,7 +44,7 @@ - + @@ -58,6 +58,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Testura.Mutation.Application/packages.config b/src/Testura.Mutation.Application/packages.config index 3544c1e..191a903 100644 --- a/src/Testura.Mutation.Application/packages.config +++ b/src/Testura.Mutation.Application/packages.config @@ -1,30 +1,52 @@  + + + - - + + + + + - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + - + + + + + @@ -49,27 +71,40 @@ + + + + + + + + + + + + + @@ -81,12 +116,14 @@ + - + + diff --git a/src/Testura.Mutation.Console/App.config b/src/Testura.Mutation.Console/App.config index 208fdff..92f6150 100644 --- a/src/Testura.Mutation.Console/App.config +++ b/src/Testura.Mutation.Console/App.config @@ -51,11 +51,11 @@ - + - + @@ -81,6 +81,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Testura.Mutation.Console/Commands/MutateLocalCommand.cs b/src/Testura.Mutation.Console/Commands/MutateLocalCommand.cs index 2e020f6..8113959 100644 --- a/src/Testura.Mutation.Console/Commands/MutateLocalCommand.cs +++ b/src/Testura.Mutation.Console/Commands/MutateLocalCommand.cs @@ -1,5 +1,4 @@ using System.Threading.Tasks; -using Microsoft.Build.Locator; using Microsoft.Practices.Unity; namespace Testura.Mutation.Console.Commands @@ -17,7 +16,6 @@ public MutateLocalCommand(string configPath, string outputPath) public async Task RunAsync() { - MSBuildLocator.RegisterDefaults(); var mutationRunner = Bootstrapper.GetContainer().Resolve(); var success = await mutationRunner.ExecuteMutationRunner(_configPath, _outputPath); diff --git a/src/Testura.Mutation.Console/Properties/AssemblyInfo.cs b/src/Testura.Mutation.Console/Properties/AssemblyInfo.cs index 95cc0bd..84275e1 100644 --- a/src/Testura.Mutation.Console/Properties/AssemblyInfo.cs +++ b/src/Testura.Mutation.Console/Properties/AssemblyInfo.cs @@ -32,7 +32,7 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.4.0.0")] +[assembly: AssemblyFileVersion("1.4.0.0")] [assembly: log4net.Config.XmlConfigurator(ConfigFile = "log4Net.config", Watch = true)] [assembly: LogMinimalMessage] diff --git a/src/Testura.Mutation.Console/Testura.Mutation.Console.csproj b/src/Testura.Mutation.Console/Testura.Mutation.Console.csproj index 90939e0..9339609 100644 --- a/src/Testura.Mutation.Console/Testura.Mutation.Console.csproj +++ b/src/Testura.Mutation.Console/Testura.Mutation.Console.csproj @@ -2,7 +2,6 @@ - @@ -84,6 +83,15 @@ ..\..\packages\Anotar.Log4Net.Fody.5.1.0\lib\net452\Anotar.Log4Net.dll + + ..\..\packages\Buildalyzer.2.5.0\lib\netstandard2.0\Buildalyzer.dll + + + ..\..\packages\Buildalyzer.Logger.2.5.0\lib\netstandard1.3\Buildalyzer.Logger.dll + + + ..\..\packages\Buildalyzer.Workspaces.2.5.0\lib\netstandard2.0\Buildalyzer.Workspaces.dll + ..\..\packages\CommandLine.Core.CommandLineUtils.1.1.0\lib\netstandard2.0\CommandLine.Core.CommandLineUtils.dll @@ -114,41 +122,50 @@ ..\..\packages\MediatR.7.0.0\lib\net461\MediatR.dll - - ..\..\packages\Microsoft.Build.Locator.1.2.6\lib\net46\Microsoft.Build.Locator.dll + + ..\..\packages\Microsoft.Build.15.8.166\lib\net46\Microsoft.Build.dll + + + ..\..\packages\Microsoft.Build.Framework.15.8.166\lib\net46\Microsoft.Build.Framework.dll + + + ..\..\packages\Microsoft.Build.Tasks.Core.15.8.166\lib\net46\Microsoft.Build.Tasks.Core.dll - - ..\..\packages\Microsoft.CodeAnalysis.Common.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.dll + + ..\..\packages\Microsoft.Build.Utilities.Core.15.8.166\lib\net46\Microsoft.Build.Utilities.Core.dll - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll + + ..\..\packages\Microsoft.CodeAnalysis.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.dll - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.MSBuild.3.3.1\lib\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll + + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.MSBuild.3.4.0\lib\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.dll ..\..\packages\Microsoft.DotNet.PlatformAbstractions.2.1.0\lib\net45\Microsoft.DotNet.PlatformAbstractions.dll - - ..\..\packages\Microsoft.Extensions.Configuration.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll + + ..\..\packages\Microsoft.Extensions.Configuration.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.dll - - ..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll + + ..\..\packages\Microsoft.Extensions.Configuration.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Abstractions.dll - - ..\..\packages\Microsoft.Extensions.Configuration.Binder.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll + + ..\..\packages\Microsoft.Extensions.Configuration.Binder.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Configuration.Binder.dll ..\..\packages\Microsoft.Extensions.Configuration.EnvironmentVariables.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Configuration.EnvironmentVariables.dll @@ -156,8 +173,8 @@ ..\..\packages\Microsoft.Extensions.DependencyInjection.2.1.0\lib\net461\Microsoft.Extensions.DependencyInjection.dll - - ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll + + ..\..\packages\Microsoft.Extensions.DependencyInjection.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll ..\..\packages\Microsoft.Extensions.DependencyModel.2.1.0\lib\net451\Microsoft.Extensions.DependencyModel.dll @@ -174,17 +191,17 @@ ..\..\packages\Microsoft.Extensions.Localization.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Localization.Abstractions.dll - - ..\..\packages\Microsoft.Extensions.Logging.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.dll + + ..\..\packages\Microsoft.Extensions.Logging.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.dll - - ..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll + + ..\..\packages\Microsoft.Extensions.Logging.Abstractions.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Logging.Abstractions.dll - - ..\..\packages\Microsoft.Extensions.Options.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Options.dll + + ..\..\packages\Microsoft.Extensions.Options.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Options.dll - - ..\..\packages\Microsoft.Extensions.Primitives.2.1.0\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll + + ..\..\packages\Microsoft.Extensions.Primitives.2.1.1\lib\netstandard2.0\Microsoft.Extensions.Primitives.dll ..\..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll @@ -198,6 +215,21 @@ ..\..\packages\Unity.4.0.1\lib\net45\Microsoft.Practices.Unity.RegistrationByConvention.dll + + ..\..\packages\Microsoft.VisualStudio.Setup.Configuration.Interop.1.16.30\lib\net35\Microsoft.VisualStudio.Setup.Configuration.Interop.dll + True + + + ..\..\packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll + True + True + + + ..\..\packages\Buildalyzer.Logger.2.5.0\lib\netstandard1.3\MsBuildPipeLogger.Logger.dll + + + ..\..\packages\MsBuildPipeLogger.Server.1.1.2\lib\netstandard1.5\MsBuildPipeLogger.Server.dll + ..\..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll @@ -216,6 +248,9 @@ ..\..\packages\SQLitePCLRaw.provider.e_sqlite3.net45.1.1.2\lib\net45\SQLitePCLRaw.provider.e_sqlite3.dll + + ..\..\packages\MSBuild.StructuredLogger.2.0.11\lib\net46\StructuredLogger.dll + ..\..\packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll @@ -245,12 +280,16 @@ ..\..\packages\System.Composition.TypedParts.1.0.31\lib\portable-net45+win8+wp8+wpa81\System.Composition.TypedParts.dll + ..\..\packages\System.Console.4.3.1\lib\net46\System.Console.dll True True + + ..\..\packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + ..\..\packages\System.Diagnostics.FileVersionInfo.4.3.0\lib\net46\System.Diagnostics.FileVersionInfo.dll True @@ -261,6 +300,16 @@ True True + + ..\..\packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll + True + True + + + ..\..\packages\System.Globalization.Calendars.4.3.0\lib\net46\System.Globalization.Calendars.dll + True + True + ..\..\packages\System.IO.4.3.0\lib\net462\System.IO.dll True @@ -271,6 +320,12 @@ True True + + + ..\..\packages\System.IO.Compression.ZipFile.4.3.0\lib\net46\System.IO.Compression.ZipFile.dll + True + True + ..\..\packages\System.IO.FileSystem.4.3.0\lib\net46\System.IO.FileSystem.dll True @@ -294,6 +349,16 @@ ..\..\packages\System.Memory.4.5.3\lib\netstandard2.0\System.Memory.dll + + ..\..\packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + True + True + + + ..\..\packages\System.Net.Sockets.4.3.0\lib\net46\System.Net.Sockets.dll + True + True + ..\..\packages\System.Numerics.Vectors.4.4.0\lib\net46\System.Numerics.Vectors.dll @@ -306,6 +371,9 @@ ..\..\packages\System.Reflection.Metadata.1.6.0\lib\netstandard2.0\System.Reflection.Metadata.dll + + ..\..\packages\System.Reflection.TypeExtensions.4.6.0\lib\net461\System.Reflection.TypeExtensions.dll + ..\..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll True @@ -329,6 +397,8 @@ True True + + ..\..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll True @@ -352,6 +422,14 @@ ..\..\packages\System.Text.Encoding.CodePages.4.5.1\lib\net461\System.Text.Encoding.CodePages.dll + + ..\..\packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll + True + True + + + ..\..\packages\System.Threading.Tasks.Dataflow.4.5.24\lib\portable-net45+win8+wpa81\System.Threading.Tasks.Dataflow.dll + ..\..\packages\System.Threading.Tasks.Extensions.4.5.3\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll @@ -363,11 +441,12 @@ ..\..\packages\System.ValueTuple.4.5.0\lib\net47\System.ValueTuple.dll + + - ..\..\packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll @@ -450,11 +529,6 @@ - - - - - @@ -468,15 +542,12 @@ - - - diff --git a/src/Testura.Mutation.Console/packages.config b/src/Testura.Mutation.Console/packages.config index aebcdac..f03e238 100644 --- a/src/Testura.Mutation.Console/packages.config +++ b/src/Testura.Mutation.Console/packages.config @@ -1,6 +1,9 @@  + + + @@ -14,32 +17,41 @@ - - + + + + + - - - - - - - + + + + + + + - - - + + + - + - - - - + + + + + + + + + + @@ -62,25 +74,37 @@ + + + + + + + + + + + + @@ -91,11 +115,14 @@ + + + diff --git a/src/Testura.Mutation.Core/Baseline/BaselineCreator.cs b/src/Testura.Mutation.Core/Baseline/BaselineCreator.cs index 95b7dd4..8112ea1 100644 --- a/src/Testura.Mutation.Core/Baseline/BaselineCreator.cs +++ b/src/Testura.Mutation.Core/Baseline/BaselineCreator.cs @@ -40,13 +40,6 @@ public BaselineCreator( private string BaselineDirectoryPath => Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "TestRun", "Baseline"); public async Task> CreateBaselineAsync(MutationConfig config, CancellationToken cancellationToken = default(CancellationToken)) - { - LogTo.Info("Opening solution.."); - var solution = await _solutionOpener.GetSolutionAsync(config); - return await CreateBaselineAsync(config, solution, cancellationToken); - } - - public async Task> CreateBaselineAsync(MutationConfig config, Microsoft.CodeAnalysis.Solution solution, CancellationToken cancellationToken = default(CancellationToken)) { LogTo.Info("Creating baseline and verifying solution/tests.."); @@ -60,7 +53,7 @@ public BaselineCreator( foreach (var mutationProject in config.MutationProjects) { - var project = solution.Projects.FirstOrDefault(p => p.Name == mutationProject.Project.Name); + var project = config.Solution.Projects.FirstOrDefault(p => p.Name == mutationProject.Project.Name); var result = await _projectCompiler.CompileAsync(BaselineDirectoryPath, project); if (!result.IsSuccess) diff --git a/src/Testura.Mutation.Core/Config/MutationConfig.cs b/src/Testura.Mutation.Core/Config/MutationConfig.cs index e15a44e..f258269 100644 --- a/src/Testura.Mutation.Core/Config/MutationConfig.cs +++ b/src/Testura.Mutation.Core/Config/MutationConfig.cs @@ -15,7 +15,7 @@ public MutationConfig() BaselineInfos = new List(); } - public string SolutionPath { get; set; } + public Microsoft.CodeAnalysis.Solution Solution { get; set; } public IList MutationProjects { get; set; } @@ -39,4 +39,4 @@ public MutationConfig() public TargetFramework TargetFramework { get; set; } } -} +} \ No newline at end of file diff --git a/src/Testura.Mutation.Core/Creator/MutationDocumentCreator.cs b/src/Testura.Mutation.Core/Creator/MutationDocumentCreator.cs index 0df4e79..71db040 100644 --- a/src/Testura.Mutation.Core/Creator/MutationDocumentCreator.cs +++ b/src/Testura.Mutation.Core/Creator/MutationDocumentCreator.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading; -using System.Threading.Tasks; using Anotar.Log4Net; using Microsoft.CodeAnalysis; using Testura.Mutation.Core.Config; @@ -20,19 +19,17 @@ public MutationDocumentCreator(ISolutionOpener solutionOpener) _solutionOpener = solutionOpener; } - public async Task> CreateMutationsAsync(MutationConfig config, CancellationToken cancellationToken = default(CancellationToken)) + public IList CreateMutations(MutationConfig config, CancellationToken cancellationToken = default(CancellationToken)) { try { - LogTo.Info("Opening solution.."); - var solution = await _solutionOpener.GetSolutionAsync(config); LogTo.Info("Starting to analyze test.."); var mutations = new List(); foreach (var mutationProjectInfo in config.MutationProjects) { - var currentProject = solution.Projects.FirstOrDefault(p => p.Name == mutationProjectInfo.Project.Name); + var currentProject = config.Solution.Projects.FirstOrDefault(p => p.Name == mutationProjectInfo.Project.Name); if (currentProject == null) { diff --git a/src/Testura.Mutation.Core/Execution/Compilation/Compiler.cs b/src/Testura.Mutation.Core/Execution/Compilation/Compiler.cs index 1c246b0..db1b628 100644 --- a/src/Testura.Mutation.Core/Execution/Compilation/Compiler.cs +++ b/src/Testura.Mutation.Core/Execution/Compilation/Compiler.cs @@ -6,6 +6,7 @@ using System.Xml.Linq; using Anotar.Log4Net; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using Newtonsoft.Json.Linq; namespace Testura.Mutation.Core.Execution.Compilation @@ -49,6 +50,15 @@ private CompilationResult EmitCompilation( { var result = compilation.Emit(path, manifestResources: GetEmbeddedResources(assemblyName, filePath)); + if (!result.Success) + { + if (result.Diagnostics.Any(d => d.GetMessage().Contains("does not contain a static 'Main'"))) + { + compilation = compilation.WithOptions(new CSharpCompilationOptions(OutputKind.DynamicallyLinkedLibrary)); + result = compilation.Emit(path, manifestResources: GetEmbeddedResources(assemblyName, filePath)); + } + } + return new CompilationResult { IsSuccess = result.Success, diff --git a/src/Testura.Mutation.Core/Solution/ISolutionOpener.cs b/src/Testura.Mutation.Core/Solution/ISolutionOpener.cs index 7566190..78c8016 100644 --- a/src/Testura.Mutation.Core/Solution/ISolutionOpener.cs +++ b/src/Testura.Mutation.Core/Solution/ISolutionOpener.cs @@ -1,12 +1,9 @@ using System.Threading.Tasks; -using Testura.Mutation.Core.Config; namespace Testura.Mutation.Core.Solution { public interface ISolutionOpener { - Task GetSolutionAsync(MutationConfig config); - Task GetSolutionAsync(string solutionPath); } -} +} \ No newline at end of file diff --git a/src/Testura.Mutation.Core/Solution/MsBuildSolutionOpener.cs b/src/Testura.Mutation.Core/Solution/MsBuildSolutionOpener.cs index 43d04d0..b1e2a85 100644 --- a/src/Testura.Mutation.Core/Solution/MsBuildSolutionOpener.cs +++ b/src/Testura.Mutation.Core/Solution/MsBuildSolutionOpener.cs @@ -1,68 +1,46 @@ -using System.Collections.Generic; -using System.IO; +using System.IO; using System.Linq; using System.Threading.Tasks; using Anotar.Log4Net; +using Buildalyzer; +using Buildalyzer.Environment; +using Buildalyzer.Workspaces; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.MSBuild; -using Testura.Mutation.Core.Config; -using Testura.Mutation.Core.Exceptions; namespace Testura.Mutation.Core.Solution { public class MsBuildSolutionOpener : ISolutionOpener { - public async Task GetSolutionAsync(MutationConfig config) + public async Task GetSolutionAsync(string solutionPath) { - using (var workspace = MSBuildWorkspace.Create(config.TargetFramework.CreateProperties())) + var log = new StringWriter(); + var analyzerOptions = new AnalyzerManagerOptions { - LogTo.Info("Opening solution.."); + LogWriter = log + }; - var solution = await workspace.OpenSolutionAsync(config.SolutionPath); + var manager = new AnalyzerManager(solutionPath, analyzerOptions); - if (workspace.Diagnostics.Any(w => w.Kind == WorkspaceDiagnosticKind.Failure && ContainsProjectName(w.Message, config.MutationProjects, config.TestProjects))) - { - LogTo.Error("Failed to open solution because of diagnostic errors."); + using (var workspace = new AdhocWorkspace()) + { + var environmentOptions = new EnvironmentOptions { DesignTime = false }; - foreach (var workspaceDiagnostic in workspace.Diagnostics.Where(d => d.Kind == WorkspaceDiagnosticKind.Failure)) + foreach (var projectKeyValue in manager.Projects) + { + LogTo.Info($"Building {Path.GetFileNameWithoutExtension(projectKeyValue.Key)}"); + var project = projectKeyValue.Value; + var results = project.Build(environmentOptions); + if (!results.OverallSuccess) { - LogTo.Error($"Workspace error: {workspaceDiagnostic.Message}"); + LogTo.Error("Failed to build"); + LogTo.Error(log.ToString); } - throw new ProjectSetUpException("Failed to open solution. View log for details."); + results.Results.First().AddToWorkspace(workspace); } - return solution; - } - } - - public async Task GetSolutionAsync(string solutionPath) - { - using (var workspace = MSBuildWorkspace.Create()) - { - return await workspace.OpenSolutionAsync(solutionPath); + return await Task.FromResult(workspace.CurrentSolution); } } - - private bool ContainsProjectName(string message, IList mutationProjects, IList testProjects) - { - foreach (var mutationProject in mutationProjects) - { - if (message.Contains(Path.GetFileName(mutationProject.Project.FilePath ?? string.Empty))) - { - return true; - } - } - - foreach (var configMutationProject in testProjects) - { - if (message.Contains(Path.GetFileName(configMutationProject.Project.FilePath ?? string.Empty))) - { - return true; - } - } - - return false; - } } -} +} \ No newline at end of file diff --git a/src/Testura.Mutation.Core/Solution/VisualStudioSolutionOpener.cs b/src/Testura.Mutation.Core/Solution/VisualStudioSolutionOpener.cs index 0c745a4..563f0cd 100644 --- a/src/Testura.Mutation.Core/Solution/VisualStudioSolutionOpener.cs +++ b/src/Testura.Mutation.Core/Solution/VisualStudioSolutionOpener.cs @@ -1,25 +1,22 @@ using System.Threading.Tasks; using Microsoft.VisualStudio.LanguageServices; -using Testura.Mutation.Core.Config; namespace Testura.Mutation.Core.Solution { public class VisualStudioSolutionOpener : ISolutionOpener { private readonly VisualStudioWorkspace _visualStudioWorkspace; + private readonly ISolutionBuilder _solutionBuilder; - public VisualStudioSolutionOpener(VisualStudioWorkspace visualStudioWorkspace) + public VisualStudioSolutionOpener(VisualStudioWorkspace visualStudioWorkspace, ISolutionBuilder solutionBuilder) { _visualStudioWorkspace = visualStudioWorkspace; - } - - public Task GetSolutionAsync(MutationConfig config) - { - return Task.FromResult(_visualStudioWorkspace.CurrentSolution); + _solutionBuilder = solutionBuilder; } public Task GetSolutionAsync(string solutionPath) { + _solutionBuilder.BuildSolution(null); return Task.FromResult(_visualStudioWorkspace.CurrentSolution); } } diff --git a/src/Testura.Mutation.Core/Testura.Mutation.Core.csproj b/src/Testura.Mutation.Core/Testura.Mutation.Core.csproj index 95a963d..4846243 100644 --- a/src/Testura.Mutation.Core/Testura.Mutation.Core.csproj +++ b/src/Testura.Mutation.Core/Testura.Mutation.Core.csproj @@ -125,6 +125,9 @@ 5.1.0 + + 2.5.0 + 2.2.0 @@ -134,22 +137,22 @@ 7.0.0 - - 1.2.6 - - 3.3.1 + 3.4.0 2.9.8 runtime; build; native; contentfiles; analyzers; buildtransitive all + + 3.4.0 + - 3.3.1 + 3.4.0 - 3.3.1 + 3.4.0 12.0.1 diff --git a/src/Testura.Mutation.VsExtension/Properties/AssemblyInfo.cs b/src/Testura.Mutation.VsExtension/Properties/AssemblyInfo.cs index 2fcc2dd..d7ca81b 100644 --- a/src/Testura.Mutation.VsExtension/Properties/AssemblyInfo.cs +++ b/src/Testura.Mutation.VsExtension/Properties/AssemblyInfo.cs @@ -28,5 +28,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.4.0.0")] +[assembly: AssemblyFileVersion("1.4.0.0")] diff --git a/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowControl.xaml b/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowControl.xaml index 9f5f373..ac4cbc2 100644 --- a/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowControl.xaml +++ b/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowControl.xaml @@ -73,17 +73,6 @@ Width="280" HorizontalAlignment="Left"/> - - - - diff --git a/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowViewModel.cs b/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowViewModel.cs index c6e9e42..a84a5e2 100644 --- a/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowViewModel.cs +++ b/src/Testura.Mutation.VsExtension/Sections/Config/MutationConfigWindowViewModel.cs @@ -58,8 +58,6 @@ public MutationConfigWindowViewModel(EnvironmentService environmentService, Solu public int NumberOfParallelTestRuns { get; set; } - public bool BuildSolution { get; set; } - public DelegateCommand TestProjectChangedCommand { get; set; } public void Initialize() @@ -105,7 +103,6 @@ public void Initialize() } RunBaseline = mutationFileConfig?.CreateBaseline ?? true; - BuildSolution = mutationFileConfig?.BuildSolution ?? true; }); } @@ -149,7 +146,6 @@ private void UpdateConfig() CreateBaseline = RunBaseline, Mutators = settings.ToList(), NumberOfTestRunInstances = NumberOfParallelTestRuns, - BuildSolution = BuildSolution }; File.WriteAllText(GetConfigPath(), JsonConvert.SerializeObject(config, new JsonSerializerSettings { NullValueHandling = NullValueHandling.Ignore })); diff --git a/src/Testura.Mutation.VsExtension/Testura.Mutation.VsExtension.csproj b/src/Testura.Mutation.VsExtension/Testura.Mutation.VsExtension.csproj index 350d9cb..c55001e 100644 --- a/src/Testura.Mutation.VsExtension/Testura.Mutation.VsExtension.csproj +++ b/src/Testura.Mutation.VsExtension/Testura.Mutation.VsExtension.csproj @@ -157,7 +157,7 @@ 7.0.0 - 3.3.1 + 3.4.0 diff --git a/src/Testura.Mutation.VsExtension/TesturaMutationVsExtensionPackage.cs b/src/Testura.Mutation.VsExtension/TesturaMutationVsExtensionPackage.cs index 79694c3..1fc9b7e 100644 --- a/src/Testura.Mutation.VsExtension/TesturaMutationVsExtensionPackage.cs +++ b/src/Testura.Mutation.VsExtension/TesturaMutationVsExtensionPackage.cs @@ -80,7 +80,7 @@ private async Task ConfigureWithEnvironmentServicesAsync(CancellationToken cance var asyncPackage = (AsyncPackage)await GetServiceAsync(typeof(AsyncPackage)); _bootstrapper.Container.RegisterInstance(new EnvironmentService(dte, JoinableTaskFactory, asyncPackage, new UserNotificationService(asyncPackage, JoinableTaskFactory, dte))); - _bootstrapper.Container.RegisterInstance(typeof(ISolutionOpener), new VisualStudioSolutionOpener(workspace)); + _bootstrapper.Container.RegisterInstance(typeof(ISolutionOpener), new VisualStudioSolutionOpener(workspace, new VisualStudioSolutionBuilder(dte, JoinableTaskFactory))); _bootstrapper.Container.RegisterInstance(typeof(ISolutionBuilder), new VisualStudioSolutionBuilder(dte, JoinableTaskFactory)); } } diff --git a/src/Testura.Mutation.VsExtension/source.extension.vsixmanifest b/src/Testura.Mutation.VsExtension/source.extension.vsixmanifest index b075136..02c2f0a 100644 --- a/src/Testura.Mutation.VsExtension/source.extension.vsixmanifest +++ b/src/Testura.Mutation.VsExtension/source.extension.vsixmanifest @@ -1,7 +1,7 @@  - + Testura.Mutation Testura is a mutation testing extension for visual studio that verifies the quality of your unit tests by injecting different mutations in your production code and then checks whether your unit tests catch them. https://github.com/Testura/Testura.Mutation diff --git a/src/Testura.Mutation.Wpf.Shared/app.config b/src/Testura.Mutation.Wpf.Shared/app.config index 419055f..bbae428 100644 --- a/src/Testura.Mutation.Wpf.Shared/app.config +++ b/src/Testura.Mutation.Wpf.Shared/app.config @@ -8,7 +8,7 @@ - + @@ -26,6 +26,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/Testura.Mutation.Wpf/Testura.Mutation.Wpf.csproj b/src/Testura.Mutation.Wpf/Testura.Mutation.Wpf.csproj index 6f25317..989b261 100644 --- a/src/Testura.Mutation.Wpf/Testura.Mutation.Wpf.csproj +++ b/src/Testura.Mutation.Wpf/Testura.Mutation.Wpf.csproj @@ -292,9 +292,6 @@ 7.0.0 - - 1.2.6 - 3.3.1 diff --git a/tests/Testura.Mutation.Tests/Testura.Mutation.Tests.csproj b/tests/Testura.Mutation.Tests/Testura.Mutation.Tests.csproj index 23c5838..dce42a9 100644 --- a/tests/Testura.Mutation.Tests/Testura.Mutation.Tests.csproj +++ b/tests/Testura.Mutation.Tests/Testura.Mutation.Tests.csproj @@ -41,26 +41,26 @@ 4 - - ..\..\packages\Microsoft.CodeAnalysis.Common.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.dll + + ..\..\packages\Microsoft.CodeAnalysis.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.dll - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.dll - - ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.CSharp.Workspaces.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.CSharp.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll + + ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.dll - - ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.VisualBasic.Workspaces.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.3.1\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.Common.3.4.0\lib\netstandard2.0\Microsoft.CodeAnalysis.Workspaces.dll - - ..\..\packages\Microsoft.CodeAnalysis.Workspaces.MSBuild.3.3.1\lib\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.dll + + ..\..\packages\Microsoft.CodeAnalysis.Workspaces.MSBuild.3.4.0\lib\net472\Microsoft.CodeAnalysis.Workspaces.MSBuild.dll ..\..\packages\MSTest.TestFramework.1.3.2\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll diff --git a/tests/Testura.Mutation.Tests/packages.config b/tests/Testura.Mutation.Tests/packages.config index effb536..e76e5c8 100644 --- a/tests/Testura.Mutation.Tests/packages.config +++ b/tests/Testura.Mutation.Tests/packages.config @@ -1,14 +1,14 @@  - + - - - - - - - + + + + + + +