diff --git a/test/TestApp-net8.0/.gitignore b/test/TestApp-net8.0/.gitignore deleted file mode 100644 index 1cc29f1..0000000 --- a/test/TestApp-net8.0/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -FodyWeavers.xml -FodyWeavers.xsd diff --git a/test/TestApp-net8.0/Program.cs b/test/TestApp-net8.0/Program.cs deleted file mode 100644 index 033b43d..0000000 --- a/test/TestApp-net8.0/Program.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Reflection; -using Microsoft.Extensions.Configuration; -using Serilog; -using Serilog.Debugging; -using Serilog.Settings.Configuration; - -if (args.Length == 1 && args[0] == "is-single-file") -{ - if (typeof(Program).Assembly.GetManifestResourceNames().Any(e => e.StartsWith("costura."))) - { - Console.WriteLine(true); - return 0; - } - // IL3000: 'System.Reflection.Assembly.Location' always returns an empty string for assemblies embedded in a single-file app -#pragma warning disable IL3000 - Console.WriteLine(string.IsNullOrEmpty(Assembly.GetEntryAssembly()?.Location)); -#pragma warning restore - return 0; -} - -SelfLog.Enable(Console.Error); - -Thread.CurrentThread.Name = "Main thread"; -const string outputTemplate = "({ThreadName}) [{Level}] {Message}{NewLine}"; - -var configurationValues = new Dictionary(); -var minimumLevelOnly = args.Contains("--minimum-level-only"); -if (minimumLevelOnly) -{ - configurationValues["Serilog:MinimumLevel"] = "Verbose"; -} -else -{ - configurationValues["Serilog:Enrich:0"] = "WithThreadName"; - configurationValues["Serilog:WriteTo:0:Name"] = "Console"; - configurationValues["Serilog:WriteTo:0:Args:outputTemplate"] = outputTemplate; -} - -if (args.Contains("--using-thread")) configurationValues["Serilog:Using:Thread"] = "Serilog.Enrichers.Thread"; -if (args.Contains("--using-console")) configurationValues["Serilog:Using:Console"] = "Serilog.Sinks.Console"; - -var assemblies = new List(); -if (args.Contains("--assembly-thread")) assemblies.Add(typeof(ThreadLoggerConfigurationExtensions).Assembly); -if (args.Contains("--assembly-console")) assemblies.Add(typeof(ConsoleLoggerConfigurationExtensions).Assembly); - -try -{ - var configuration = new ConfigurationBuilder().AddInMemoryCollection(configurationValues).Build(); - var options = assemblies.Count > 0 ? new ConfigurationReaderOptions(assemblies.ToArray()) : null; - var loggerConfiguration = new LoggerConfiguration().ReadFrom.Configuration(configuration, options); - if (minimumLevelOnly) - { - loggerConfiguration - .Enrich.WithThreadName() - .WriteTo.Console(outputTemplate: outputTemplate); - } - var logger = loggerConfiguration.CreateLogger(); - logger.Information("Expected success"); - return 0; -} -catch (InvalidOperationException exception) when (exception.Message.StartsWith("No Serilog:Using configuration section is defined and no Serilog assemblies were found.")) -{ - Console.WriteLine("Expected exception"); - return 0; -} -catch (Exception exception) -{ - Console.Error.WriteLine(exception); - return 1; -} diff --git a/test/TestApp-net8.0/Serilog.Settings.Configuration.0.0.0-IntegrationTest.0.snupkg b/test/TestApp-net8.0/Serilog.Settings.Configuration.0.0.0-IntegrationTest.0.snupkg deleted file mode 100644 index deabba3..0000000 Binary files a/test/TestApp-net8.0/Serilog.Settings.Configuration.0.0.0-IntegrationTest.0.snupkg and /dev/null differ diff --git a/test/TestApp-net8.0/TestApp.csproj b/test/TestApp-net8.0/TestApp.csproj deleted file mode 100644 index 58a459a..0000000 --- a/test/TestApp-net8.0/TestApp.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - - Exe - net48 - embedded - false - false - false - none - true - true - false - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/TestApp-net8.0/nuget.config b/test/TestApp-net8.0/nuget.config deleted file mode 100644 index cfec8fc..0000000 --- a/test/TestApp-net8.0/nuget.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - -