From 5e3aa442b813e719b5179937e3d08321b651f15b Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Fri, 30 Nov 2018 17:18:49 -0800 Subject: [PATCH 1/6] Convert to .NET Core 3.0 --- xunit.runner.wpf/MainWindow.xaml.cs | 1 + xunit.runner.wpf/ViewModel/MainViewModel.cs | 2 +- .../ViewModel/ViewModelLocator.cs | 2 +- xunit.runner.wpf/xunit.runner.wpf.csproj | 213 ++---------------- 4 files changed, 21 insertions(+), 197 deletions(-) diff --git a/xunit.runner.wpf/MainWindow.xaml.cs b/xunit.runner.wpf/MainWindow.xaml.cs index d46e4e1..c249065 100644 --- a/xunit.runner.wpf/MainWindow.xaml.cs +++ b/xunit.runner.wpf/MainWindow.xaml.cs @@ -5,6 +5,7 @@ namespace Xunit.Runner.Wpf { + using GalaSoft.MvvmLight.Command; using ViewModel; public partial class MainWindow : Window diff --git a/xunit.runner.wpf/ViewModel/MainViewModel.cs b/xunit.runner.wpf/ViewModel/MainViewModel.cs index 6da0ad2..eb62dbb 100644 --- a/xunit.runner.wpf/ViewModel/MainViewModel.cs +++ b/xunit.runner.wpf/ViewModel/MainViewModel.cs @@ -12,7 +12,7 @@ using System.Windows.Input; using System.Windows.Threading; using GalaSoft.MvvmLight; -using GalaSoft.MvvmLight.CommandWpf; +using GalaSoft.MvvmLight.Command; using Microsoft.Win32; using Microsoft.WindowsAPICodePack.Taskbar; using Xunit.Runner.Data; diff --git a/xunit.runner.wpf/ViewModel/ViewModelLocator.cs b/xunit.runner.wpf/ViewModel/ViewModelLocator.cs index b45f1d6..48c55ba 100644 --- a/xunit.runner.wpf/ViewModel/ViewModelLocator.cs +++ b/xunit.runner.wpf/ViewModel/ViewModelLocator.cs @@ -12,8 +12,8 @@ See http://www.galasoft.ch/mvvm */ +using CommonServiceLocator; using GalaSoft.MvvmLight.Ioc; -using Microsoft.Practices.ServiceLocation; namespace Xunit.Runner.Wpf.ViewModel { diff --git a/xunit.runner.wpf/xunit.runner.wpf.csproj b/xunit.runner.wpf/xunit.runner.wpf.csproj index 551bc09..88abc3f 100644 --- a/xunit.runner.wpf/xunit.runner.wpf.csproj +++ b/xunit.runner.wpf/xunit.runner.wpf.csproj @@ -1,220 +1,43 @@ - - - - + - Debug - AnyCPU - {34FB519C-FB49-4B31-ACA2-7F7879311BCF} WinExe Properties Xunit.Runner.Wpf - xunit.runner.wpf - v4.6 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - + netcoreapp3.0 $(appveyor_build_version) 1.0.0-local - - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - Artwork\Application.ico + true + false + - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.dll - True - - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Extras.dll - True - - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\GalaSoft.MvvmLight.Platform.dll - True - - - ..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll - True - - - ..\packages\WindowsAPICodePack-Core.1.1.2\lib\Microsoft.WindowsAPICodePack.dll - True - - - ..\packages\WindowsAPICodePack-Shell.1.1.1\lib\Microsoft.WindowsAPICodePack.Shell.dll - True - - - - ..\packages\System.Collections.Immutable.1.4.0-preview1-25305-02\lib\portable-net45+win8+wp8+wpa81\System.Collections.Immutable.dll - - - - - ..\packages\MvvmLightLibs.5.3.0.0\lib\net45\System.Windows.Interactivity.dll - True - - - - - - - - - 4.0 - - - - - - ..\packages\xunit.runner.utility.2.1.0\lib\net35\xunit.runner.utility.desktop.dll - True - - - - - MSBuild:Compile - Designer - - - - - - - - - - - - - - - - - - - - - - - - - - - MSBuild:Compile - Designer - - - App.xaml - Code - - - MainWindow.xaml - Code - - - - - Code - - - True - True - Resources.resx - - - ResXFileCodeGenerator - Resources.Designer.cs - - - - - PreserveNewest - Designer - + + + + + + + + $(NuPkgVersion) False - - - + - {bdafb5dd-ffb3-4a94-a312-dfb080010846} - SampleTestAssembly false - - {a1f579f4-443e-4f64-bc55-998ab86ff293} - xunit.runner.data - - - {9df97a2b-0eb5-4b12-9f81-69dfac979814} - xunit.runner.worker - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - \ No newline at end of file From 225148777807a6818f73bb46f7665b403b2ece87 Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Fri, 30 Nov 2018 18:11:39 -0800 Subject: [PATCH 2/6] Convert the rest of the projectS --- SampleTestAssembly/SampleTestAssembly.csproj | 74 +--------------- SampleTestAssembly/packages.config | 9 -- xunit.runner.data/xunit.runner.data.csproj | 58 +------------ .../MessageSinks/BaseMessageSink.cs | 1 + xunit.runner.worker/packages.config | 5 -- .../xunit.runner.worker.csproj | 84 ++----------------- xunit.runner.wpf/packages.config | 21 ----- xunit.runner.wpf/xunit.runner.wpf.csproj | 2 +- 8 files changed, 14 insertions(+), 240 deletions(-) delete mode 100644 SampleTestAssembly/packages.config delete mode 100644 xunit.runner.worker/packages.config delete mode 100644 xunit.runner.wpf/packages.config diff --git a/SampleTestAssembly/SampleTestAssembly.csproj b/SampleTestAssembly/SampleTestAssembly.csproj index 88b95d7..6854684 100644 --- a/SampleTestAssembly/SampleTestAssembly.csproj +++ b/SampleTestAssembly/SampleTestAssembly.csproj @@ -1,75 +1,9 @@ - - - + - Debug - AnyCPU - {BDAFB5DD-FFB3-4A94-A312-DFB080010846} - Library - Properties - SampleTestAssembly - SampleTestAssembly - v4.5.2 - 512 - - + net461 + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - - - + - - \ No newline at end of file diff --git a/SampleTestAssembly/packages.config b/SampleTestAssembly/packages.config deleted file mode 100644 index 44a585a..0000000 --- a/SampleTestAssembly/packages.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/xunit.runner.data/xunit.runner.data.csproj b/xunit.runner.data/xunit.runner.data.csproj index ddeabe8..d8fdffa 100644 --- a/xunit.runner.data/xunit.runner.data.csproj +++ b/xunit.runner.data/xunit.runner.data.csproj @@ -1,59 +1,7 @@ - - - + - Debug - AnyCPU - {A1F579F4-443E-4F64-BC55-998AB86FF293} - Library - Properties Xunit.Runner.Data - xunit.runner.data - v4.5.2 - 512 + netstandard20 + false - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/xunit.runner.worker/MessageSinks/BaseMessageSink.cs b/xunit.runner.worker/MessageSinks/BaseMessageSink.cs index 47d17e9..55e524d 100644 --- a/xunit.runner.worker/MessageSinks/BaseMessageSink.cs +++ b/xunit.runner.worker/MessageSinks/BaseMessageSink.cs @@ -1,5 +1,6 @@ using System; using Xunit.Abstractions; +using Xunit.Sdk; namespace Xunit.Runner.Worker.MessageSinks { diff --git a/xunit.runner.worker/packages.config b/xunit.runner.worker/packages.config deleted file mode 100644 index f3e206d..0000000 --- a/xunit.runner.worker/packages.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/xunit.runner.worker/xunit.runner.worker.csproj b/xunit.runner.worker/xunit.runner.worker.csproj index 5f90231..d0d604c 100644 --- a/xunit.runner.worker/xunit.runner.worker.csproj +++ b/xunit.runner.worker/xunit.runner.worker.csproj @@ -1,86 +1,12 @@ - - - + - Debug - AnyCPU - {9DF97A2B-0EB5-4B12-9F81-69DFAC979814} Exe - Properties Xunit.Runner.Worker - xunit.runner.worker - v4.6 - 512 - true - - - + net461 + false - - AnyCPU - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - AnyCPU - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - ..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - - - ..\packages\xunit.runner.utility.2.1.0\lib\net35\xunit.runner.utility.desktop.dll - True - - - - - - - - - - - - - - - - - - - - - {a1f579f4-443e-4f64-bc55-998ab86ff293} - xunit.runner.data - + + - - \ No newline at end of file diff --git a/xunit.runner.wpf/packages.config b/xunit.runner.wpf/packages.config deleted file mode 100644 index eeaf669..0000000 --- a/xunit.runner.wpf/packages.config +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/xunit.runner.wpf/xunit.runner.wpf.csproj b/xunit.runner.wpf/xunit.runner.wpf.csproj index 88abc3f..6d4dcf8 100644 --- a/xunit.runner.wpf/xunit.runner.wpf.csproj +++ b/xunit.runner.wpf/xunit.runner.wpf.csproj @@ -10,7 +10,7 @@ true false - + From 709b166870e36b3ad217fcfc4a5fc95f80b8af82 Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Fri, 30 Nov 2018 18:26:55 -0800 Subject: [PATCH 3/6] Revert to .NET 4.5.2 and xunit.runner.utility 2.1.0 --- xunit.runner.data/xunit.runner.data.csproj | 2 +- xunit.runner.worker/xunit.runner.worker.csproj | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xunit.runner.data/xunit.runner.data.csproj b/xunit.runner.data/xunit.runner.data.csproj index d8fdffa..0aab30d 100644 --- a/xunit.runner.data/xunit.runner.data.csproj +++ b/xunit.runner.data/xunit.runner.data.csproj @@ -1,7 +1,7 @@  Xunit.Runner.Data - netstandard20 + net452 false \ No newline at end of file diff --git a/xunit.runner.worker/xunit.runner.worker.csproj b/xunit.runner.worker/xunit.runner.worker.csproj index d0d604c..1be4f1a 100644 --- a/xunit.runner.worker/xunit.runner.worker.csproj +++ b/xunit.runner.worker/xunit.runner.worker.csproj @@ -2,11 +2,11 @@ Exe Xunit.Runner.Worker - net461 + net452 false - + \ No newline at end of file From 8e6a0ea916487fb0c8fbc3986f5d35fe55a954ee Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Sat, 1 Dec 2018 12:56:01 -0800 Subject: [PATCH 4/6] Don't create windows for worker processes --- xunit.runner.wpf/Impl/RemoteTestUtil.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xunit.runner.wpf/Impl/RemoteTestUtil.cs b/xunit.runner.wpf/Impl/RemoteTestUtil.cs index 0c97f1c..322769b 100644 --- a/xunit.runner.wpf/Impl/RemoteTestUtil.cs +++ b/xunit.runner.wpf/Impl/RemoteTestUtil.cs @@ -84,6 +84,8 @@ private static ProcessInfo StartWorkerProcess() processStartInfo.FileName = typeof(Xunit.Runner.Worker.Program).Assembly.Location; processStartInfo.Arguments = $"{pipeName} {Process.GetCurrentProcess().Id}"; processStartInfo.WindowStyle = ProcessWindowStyle.Hidden; + processStartInfo.UseShellExecute = false; + processStartInfo.CreateNoWindow = true; var process = Process.Start(processStartInfo); return new ProcessInfo(pipeName, process); } From b7293a15f7ce9d0610f82da379d4f43ea1c10174 Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Sun, 2 Dec 2018 16:22:07 -0800 Subject: [PATCH 5/6] Generate AssemblyInfos, get rid of App.config, and change NuGet package to global tool --- SampleTestAssembly/Properties/AssemblyInfo.cs | 36 ------------------ SampleTestAssembly/SampleTestAssembly.csproj | 4 +- xunit.runner.data/Properties/AssemblyInfo.cs | 35 ------------------ xunit.runner.data/xunit.runner.data.csproj | 3 +- .../Properties/AssemblyInfo.cs | 35 ------------------ .../xunit.runner.worker.csproj | 4 +- xunit.runner.wpf/App.config | 6 --- xunit.runner.wpf/Properties/AssemblyInfo.cs | 37 +------------------ xunit.runner.wpf/xunit.runner.wpf.csproj | 29 ++++++++------- xunit.runner.wpf/xunit.runner.wpf.nuspec | 20 ---------- xunit.runner.wpf/xunit.runner.wpf.targets | 9 ----- 11 files changed, 25 insertions(+), 193 deletions(-) delete mode 100644 SampleTestAssembly/Properties/AssemblyInfo.cs delete mode 100644 xunit.runner.data/Properties/AssemblyInfo.cs delete mode 100644 xunit.runner.worker/Properties/AssemblyInfo.cs delete mode 100644 xunit.runner.wpf/App.config delete mode 100644 xunit.runner.wpf/xunit.runner.wpf.nuspec delete mode 100644 xunit.runner.wpf/xunit.runner.wpf.targets diff --git a/SampleTestAssembly/Properties/AssemblyInfo.cs b/SampleTestAssembly/Properties/AssemblyInfo.cs deleted file mode 100644 index 4a5bc90..0000000 --- a/SampleTestAssembly/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("SampleTestAssembly")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("SampleTestAssembly")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("bdafb5dd-ffb3-4a94-a312-dfb080010846")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/SampleTestAssembly/SampleTestAssembly.csproj b/SampleTestAssembly/SampleTestAssembly.csproj index 6854684..b8b1d3e 100644 --- a/SampleTestAssembly/SampleTestAssembly.csproj +++ b/SampleTestAssembly/SampleTestAssembly.csproj @@ -1,9 +1,11 @@  + net461 - false + + \ No newline at end of file diff --git a/xunit.runner.data/Properties/AssemblyInfo.cs b/xunit.runner.data/Properties/AssemblyInfo.cs deleted file mode 100644 index c41dd9f..0000000 --- a/xunit.runner.data/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("xunit.runner.data")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("xunit.runner.data")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("a1f579f4-443e-4f64-bc55-998ab86ff293")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/xunit.runner.data/xunit.runner.data.csproj b/xunit.runner.data/xunit.runner.data.csproj index 0aab30d..d22e7a7 100644 --- a/xunit.runner.data/xunit.runner.data.csproj +++ b/xunit.runner.data/xunit.runner.data.csproj @@ -1,7 +1,8 @@  + Xunit.Runner.Data net452 - false + \ No newline at end of file diff --git a/xunit.runner.worker/Properties/AssemblyInfo.cs b/xunit.runner.worker/Properties/AssemblyInfo.cs deleted file mode 100644 index 5aa7b35..0000000 --- a/xunit.runner.worker/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("xunit.runner.worker")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("xunit.runner.worker")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("9df97a2b-0eb5-4b12-9f81-69dfac979814")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/xunit.runner.worker/xunit.runner.worker.csproj b/xunit.runner.worker/xunit.runner.worker.csproj index 1be4f1a..e1d06a2 100644 --- a/xunit.runner.worker/xunit.runner.worker.csproj +++ b/xunit.runner.worker/xunit.runner.worker.csproj @@ -1,12 +1,14 @@  + Exe Xunit.Runner.Worker net452 - false + + \ No newline at end of file diff --git a/xunit.runner.wpf/App.config b/xunit.runner.wpf/App.config deleted file mode 100644 index 2d2a12d..0000000 --- a/xunit.runner.wpf/App.config +++ /dev/null @@ -1,6 +0,0 @@ - - - - - - diff --git a/xunit.runner.wpf/Properties/AssemblyInfo.cs b/xunit.runner.wpf/Properties/AssemblyInfo.cs index 2252cdb..aff6210 100644 --- a/xunit.runner.wpf/Properties/AssemblyInfo.cs +++ b/xunit.runner.wpf/Properties/AssemblyInfo.cs @@ -1,25 +1,4 @@ -using System.Reflection; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Windows; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("xunit.runner.wpf")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("xunit.runner.wpf")] -[assembly: AssemblyCopyright("Copyright © 2015")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] +using System.Windows; //In order to begin building localizable applications, set //CultureYouAreCodingWith in your .csproj file @@ -39,17 +18,3 @@ //(used if a resource is not found in the page, // app, or any theme specific resource dictionaries) )] - - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// 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.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/xunit.runner.wpf/xunit.runner.wpf.csproj b/xunit.runner.wpf/xunit.runner.wpf.csproj index 6d4dcf8..6505610 100644 --- a/xunit.runner.wpf/xunit.runner.wpf.csproj +++ b/xunit.runner.wpf/xunit.runner.wpf.csproj @@ -1,14 +1,23 @@  WinExe - Properties - Xunit.Runner.Wpf netcoreapp3.0 - $(appveyor_build_version) - 1.0.0-local - Artwork\Application.ico true - false + Xunit.Runner.Wpf + NU1701;$(NoWarn) + Artwork\Application.ico + Pilchie + true + true + XUnit Gui written in WPF + https://github.com/Pilchie/xunit.runner.wpf + https://github.com/Pilchie/xunit.runner.wpf + XUnit Gui test runner + en-us + $(appveyor_build_version) + 1.0.0-local + $(appveyor_build_version) + $(appveyor_build_version) @@ -21,13 +30,6 @@ - - - $(NuPkgVersion) - False - - - false @@ -40,4 +42,5 @@ + \ No newline at end of file diff --git a/xunit.runner.wpf/xunit.runner.wpf.nuspec b/xunit.runner.wpf/xunit.runner.wpf.nuspec deleted file mode 100644 index e5bca01..0000000 --- a/xunit.runner.wpf/xunit.runner.wpf.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - xunit.runner.wpf - $version$ - xUnit.Runner.WPF - Pilchie - Pilchie - https://github.com/Pilchie/xunit.runner.wpf - false - XUnit Gui written in WPF - XUnit Gui test runner - - - - - - - - diff --git a/xunit.runner.wpf/xunit.runner.wpf.targets b/xunit.runner.wpf/xunit.runner.wpf.targets deleted file mode 100644 index 5766cc9..0000000 --- a/xunit.runner.wpf/xunit.runner.wpf.targets +++ /dev/null @@ -1,9 +0,0 @@ - - - - Program - $(MSBuildThisFileDirectory)..\tools\xunit.runner.wpf.exe - $(AssemblyName).dll - $(OutputDirectory) - - From 41c928202333053fd2c596c59b9b9bfe58bc16ed Mon Sep 17 00:00:00 2001 From: Kevin Pilch Date: Sun, 2 Dec 2018 17:01:12 -0800 Subject: [PATCH 6/6] Update to latest xunit, and target net472 and netstandard2.0 --- SampleTestAssembly/SampleTestAssembly.csproj | 2 +- xunit.runner.data/xunit.runner.data.csproj | 2 +- xunit.runner.worker/AssemblyHelper.cs | 110 ++++++++++++++++++ xunit.runner.worker/XunitUtil.cs | 2 +- .../xunit.runner.worker.csproj | 4 +- xunit.runner.wpf/xunit.runner.wpf.csproj | 2 +- 6 files changed, 116 insertions(+), 6 deletions(-) create mode 100644 xunit.runner.worker/AssemblyHelper.cs diff --git a/SampleTestAssembly/SampleTestAssembly.csproj b/SampleTestAssembly/SampleTestAssembly.csproj index b8b1d3e..497d7de 100644 --- a/SampleTestAssembly/SampleTestAssembly.csproj +++ b/SampleTestAssembly/SampleTestAssembly.csproj @@ -1,7 +1,7 @@  - net461 + netstandard2.0 diff --git a/xunit.runner.data/xunit.runner.data.csproj b/xunit.runner.data/xunit.runner.data.csproj index d22e7a7..d69f99b 100644 --- a/xunit.runner.data/xunit.runner.data.csproj +++ b/xunit.runner.data/xunit.runner.data.csproj @@ -2,7 +2,7 @@ Xunit.Runner.Data - net452 + netstandard2.0 \ No newline at end of file diff --git a/xunit.runner.worker/AssemblyHelper.cs b/xunit.runner.worker/AssemblyHelper.cs new file mode 100644 index 0000000..d8283c4 --- /dev/null +++ b/xunit.runner.worker/AssemblyHelper.cs @@ -0,0 +1,110 @@ +#if NETFRAMEWORK + +// Taken from https://github.com/xunit/xunit/blob/master/src/common/AssemblyResolution/AssemblyHelper_Desktop.cs + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.IO; +using System.Reflection; +using Xunit.Abstractions; +using Xunit.Sdk; + +namespace Xunit +{ + /// + /// This class provides assistance with assembly resolution for missing assemblies. + /// + class AssemblyHelper : LongLivedMarshalByRefObject, IDisposable + { + static readonly string[] Extensions = { ".dll", ".exe" }; + + readonly string directory; + readonly IMessageSink internalDiagnosticsMessageSink; + readonly Dictionary lookupCache = new Dictionary(); + + /// + /// Constructs an instance using the given for resolution. + /// + /// The directory to use for resolving assemblies. + public AssemblyHelper(string directory) : this(directory, null) { } + + /// + /// Constructs an instance using the given for resolution. + /// + /// The directory to use for resolving assemblies. + /// The message sink to send internal diagnostics messages to + public AssemblyHelper(string directory, IMessageSink internalDiagnosticsMessageSink) + { + this.directory = directory; + this.internalDiagnosticsMessageSink = internalDiagnosticsMessageSink; + + AppDomain.CurrentDomain.AssemblyResolve += Resolve; + } + + /// + public void Dispose() + => AppDomain.CurrentDomain.AssemblyResolve -= Resolve; + + Assembly LoadAssembly(AssemblyName assemblyName) + { + if (lookupCache.TryGetValue(assemblyName.Name, out var result)) + return result; + + var path = Path.Combine(directory, assemblyName.Name); + result = ResolveAndLoadAssembly(path, out var resolvedAssemblyPath); + + if (internalDiagnosticsMessageSink != null) + { + if (result == null) + internalDiagnosticsMessageSink.OnMessage(new DiagnosticMessage($"[AssemblyHelper_Desktop.LoadAssembly] Resolution for '{assemblyName.Name}' failed, passed down to next resolver")); + else + internalDiagnosticsMessageSink.OnMessage(new DiagnosticMessage($"[AssemblyHelper_Desktop.LoadAssembly] Resolved '{assemblyName.Name}' to '{resolvedAssemblyPath}'")); + } + + lookupCache[assemblyName.Name] = result; + return result; + } + + Assembly Resolve(object sender, ResolveEventArgs args) + => LoadAssembly(new AssemblyName(args.Name)); + + Assembly ResolveAndLoadAssembly(string pathWithoutExtension, out string resolvedAssemblyPath) + { + foreach (var extension in Extensions) + { + resolvedAssemblyPath = pathWithoutExtension + extension; + + try + { + if (File.Exists(resolvedAssemblyPath)) + return Assembly.LoadFrom(resolvedAssemblyPath); + } + catch { } + } + + resolvedAssemblyPath = null; + return null; + } + + /// + /// Subscribes to the appropriate assembly resolution event, to provide automatic assembly resolution for + /// an assembly and any of its dependencies. Depending on the target platform, this may include the use + /// of the .deps.json file generated during the build process. + /// + /// An object which, when disposed, un-subscribes. + public static IDisposable SubscribeResolveForAssembly(string assemblyFileName, IMessageSink internalDiagnosticsMessageSink = null) + => new AssemblyHelper(Path.GetDirectoryName(Path.GetFullPath(assemblyFileName)), internalDiagnosticsMessageSink); + + /// + /// Subscribes to the appropriate assembly resolution event, to provide automatic assembly resolution for + /// an assembly and any of its dependencies. Depending on the target platform, this may include the use + /// of the .deps.json file generated during the build process. + /// + /// An object which, when disposed, un-subscribes. + public static IDisposable SubscribeResolveForAssembly(Type typeInAssembly, IMessageSink internalDiagnosticsMessageSink = null) + => new AssemblyHelper(Path.GetDirectoryName(typeInAssembly.Assembly.Location), internalDiagnosticsMessageSink); + } +} + +#endif \ No newline at end of file diff --git a/xunit.runner.worker/XunitUtil.cs b/xunit.runner.worker/XunitUtil.cs index f3e8e74..7a5f6a4 100644 --- a/xunit.runner.worker/XunitUtil.cs +++ b/xunit.runner.worker/XunitUtil.cs @@ -9,7 +9,7 @@ internal abstract class XunitUtil protected static void Go(string assemblyFileName, Stream stream, AppDomainSupport appDomainSupport, Action action) { - using (AssemblyHelper.SubscribeResolve()) + using (AssemblyHelper.SubscribeResolveForAssembly(assemblyFileName)) using (var xunit = new XunitFrontController(appDomainSupport, assemblyFileName, shadowCopy: false)) using (var writer = new ClientWriter(stream)) { diff --git a/xunit.runner.worker/xunit.runner.worker.csproj b/xunit.runner.worker/xunit.runner.worker.csproj index e1d06a2..fec894e 100644 --- a/xunit.runner.worker/xunit.runner.worker.csproj +++ b/xunit.runner.worker/xunit.runner.worker.csproj @@ -3,11 +3,11 @@ Exe Xunit.Runner.Worker - net452 + net472 - + diff --git a/xunit.runner.wpf/xunit.runner.wpf.csproj b/xunit.runner.wpf/xunit.runner.wpf.csproj index 6505610..0c94732 100644 --- a/xunit.runner.wpf/xunit.runner.wpf.csproj +++ b/xunit.runner.wpf/xunit.runner.wpf.csproj @@ -9,6 +9,7 @@ Pilchie true true + net472 XUnit Gui written in WPF https://github.com/Pilchie/xunit.runner.wpf https://github.com/Pilchie/xunit.runner.wpf @@ -27,7 +28,6 @@ -