Browse Source

Fixed build by disabling DocumentOperation tests on linux-musl-x64

Marcin Ziąbek 9 months ago
parent
commit
7ad3d7c812

+ 8 - 0
Source/QuestPDF.DocumentationExamples/DocumentOperationExamples.cs

@@ -1,11 +1,19 @@
+using System.Runtime.InteropServices;
 using QuestPDF.Fluent;
 using QuestPDF.Helpers;
 using QuestPDF.Infrastructure;
 
 namespace QuestPDF.DocumentationExamples;
 
+[TestFixture]
 public class DocumentOperationExamples
 {
+    public DocumentOperationExamples()
+    {
+        if (RuntimeInformation.RuntimeIdentifier == "linux-musl-x64")
+            Assert.Ignore("The DocumentOperations functionality is not supported on Linux Musl, e.g. Alpine.");
+    }
+    
     [Test]
     public void MergeFiles()
     {

+ 1 - 1
Source/QuestPDF/Helpers/NativeDependencyCompatibilityChecker.cs

@@ -86,7 +86,7 @@ namespace QuestPDF.Helpers
                 {
                     var glibcVersion = NativeDependencyProvider.GetGlibcVersion();
 
-                    if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && glibcVersion < RequiredGlibcVersionOnLinux)
+                    if (glibcVersion != null && glibcVersion < RequiredGlibcVersionOnLinux)
                     {
                         message += $"{paragraph}Please consider updating your operating system distribution. " +
                                    $"Current GLIBC version: {glibcVersion}. " +

+ 0 - 1
Source/QuestPDF/QuestPDF.csproj

@@ -36,7 +36,6 @@
     
     <ItemGroup Condition="'$(BUILD_PACKAGE)' == ''">
         <InternalsVisibleTo Include="DynamicProxyGenAssembly2" />
-        <InternalsVisibleTo Include="QuestPDF.Examples" />
         <InternalsVisibleTo Include="QuestPDF.UnitTests" />
         <InternalsVisibleTo Include="QuestPDF.LayoutTests" />
     </ItemGroup>