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 88b95d7..497d7de 100644 --- a/SampleTestAssembly/SampleTestAssembly.csproj +++ b/SampleTestAssembly/SampleTestAssembly.csproj @@ -1,75 +1,11 @@ - - - + + - Debug - AnyCPU - {BDAFB5DD-FFB3-4A94-A312-DFB080010846} - Library - Properties - SampleTestAssembly - SampleTestAssembly - v4.5.2 - 512 - - + netstandard2.0 - - 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/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 ddeabe8..d69f99b 100644 --- a/xunit.runner.data/xunit.runner.data.csproj +++ b/xunit.runner.data/xunit.runner.data.csproj @@ -1,59 +1,8 @@ - - - + + - Debug - AnyCPU - {A1F579F4-443E-4F64-BC55-998AB86FF293} - Library - Properties Xunit.Runner.Data - xunit.runner.data - v4.5.2 - 512 + netstandard2.0 - - 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/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/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/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/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/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..fec894e 100644 --- a/xunit.runner.worker/xunit.runner.worker.csproj +++ b/xunit.runner.worker/xunit.runner.worker.csproj @@ -1,86 +1,14 @@ - - - + + - Debug - AnyCPU - {9DF97A2B-0EB5-4B12-9F81-69DFAC979814} Exe - Properties Xunit.Runner.Worker - xunit.runner.worker - v4.6 - 512 - true - - - + net472 - - 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/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/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); } 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/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/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/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 551bc09..0c94732 100644 --- a/xunit.runner.wpf/xunit.runner.wpf.csproj +++ b/xunit.runner.wpf/xunit.runner.wpf.csproj @@ -1,220 +1,46 @@ - - - - + - Debug - AnyCPU - {34FB519C-FB49-4B31-ACA2-7F7879311BCF} WinExe - Properties + netcoreapp3.0 + true Xunit.Runner.Wpf - xunit.runner.wpf - v4.6 - 512 - {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 4 - true - - - - $(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 - - + NU1701;$(NoWarn) Artwork\Application.ico + Pilchie + true + true + net472 + 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) + - - ..\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 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) - -