Browse Source

Added flag that disables showing test results

Marcin Ziąbek 1 year ago
parent
commit
5563092af6

+ 2 - 2
Source/QuestPDF.Examples/Engine/RenderingTest.cs

@@ -25,11 +25,11 @@ namespace QuestPDF.Examples.Engine
         private bool ApplyDebugging { get; set; }
         private bool ApplyDebugging { get; set; }
         private RenderingTestResult ResultType { get; set; } = RenderingTestResult.Images;
         private RenderingTestResult ResultType { get; set; } = RenderingTestResult.Images;
 
 
-        private bool ShowingResultsEnabled = true;
+        private static readonly bool ShowingResultsEnabled = (Environment.GetEnvironmentVariable("TEST_SHOW_RESULTS") ?? "true") == "true";
         
         
         private RenderingTest()
         private RenderingTest()
         {
         {
-            
+            Console.WriteLine("Showing results: " + ShowingResultsEnabled);
         }
         }
 
 
         public static RenderingTest Create([CallerMemberName] string fileName = "test")
         public static RenderingTest Create([CallerMemberName] string fileName = "test")

+ 1 - 1
Source/QuestPDF.UnitTests/DocumentCompressionTests.cs

@@ -61,7 +61,7 @@ public class DocumentCompressionTests
         var sizeRatio = withoutCompression.documentSize / (float)withCompression.documentSize;
         var sizeRatio = withoutCompression.documentSize / (float)withCompression.documentSize;
         sizeRatio.Should().BeGreaterThan(3);
         sizeRatio.Should().BeGreaterThan(3);
 
 
-        Math.Abs(withCompression.generationTime - withoutCompression.generationTime).Should().BeLessThan(100);
+        Math.Abs(withCompression.generationTime - withoutCompression.generationTime).Should().BeLessThan(200);
         
         
         (int documentSize, float generationTime) MeasureDocumentSizeAndGenerationTime(bool compress)
         (int documentSize, float generationTime) MeasureDocumentSizeAndGenerationTime(bool compress)
         {
         {