[Bps-public-commit] gdgraph branch libgd-image-disabled created. 5889cbc579bdac8056e20f6a006cb3c7958f445f

BPS Git Server git at git.bestpractical.com
Wed Jan 11 21:17:19 UTC 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gdgraph".

The branch, libgd-image-disabled has been created
        at  5889cbc579bdac8056e20f6a006cb3c7958f445f (commit)

- Log -----------------------------------------------------------------
commit 5889cbc579bdac8056e20f6a006cb3c7958f445f
Author: Jim Brandt <jbrandt at bestpractical.com>
Date:   Wed Jan 11 16:15:18 2023 -0500

    Skip samples tests if GD image support is disabled
    
    Starting with version 2.3.3, libgd has image support disabled
    by default, so some packages are building that way. Skip
    samples tests to avoid test failures.
    
    To run these tests, install libgd with --enable-gd-formats. See:
    
    https://github.com/libgd/libgd/issues/428

diff --git a/t/samples.t b/t/samples.t
index 140992d..cff3aa3 100644
--- a/t/samples.t
+++ b/t/samples.t
@@ -10,16 +10,34 @@ push @INC, "$Bin/../samples";
 $ENV{GDGRAPH_SAMPLES_PATH} = "$Bin/../samples/";
 
 my @samples = glob("$Bin/../samples/sample*.pl");
-plan tests => 2 * @samples;
+my $test_count = 2 * @samples;
+plan tests => $test_count;
 
-for my $sample (@samples) {
-    lives_ok {
-        my $stderr = capture_stderr { require $sample };
-        my ($sample_name) = $sample =~ m{samples/(sample..)};
-        like $stderr, qr/Processing $sample_name/;
+
+# Check for known GD error message when libgd has image support disabled
+use GD::Graph::bars;
+my $graph = GD::Graph::bars->new;
+eval {
+    capture_stderr { $graph->export_format };
+};
+
+my $skip;
+if ( $@ and $@ =~ /gdImageGdPtr/ ) {
+    $skip = 1;
+}
+
+SKIP: {
+    skip "GD image support has been disabled in installed libgd, skipping", $test_count if $skip;
+    for my $sample (@samples) {
+        lives_ok {
+            my $stderr = capture_stderr { require $sample };
+            my ($sample_name) = $sample =~ m{samples/(sample..)};
+            like $stderr, qr/Processing $sample_name/;
+        }
     }
+
+    unlink $_ for glob("sample*.gif");
 }
 
-unlink $_ for glob("sample*.gif");
 
 done_testing();
commit c4dad114442265d1a596bdaf7ebd693b7348e190
Author: Brian Conry <bconry at bestpractical.com>
Date:   Tue Feb 15 08:05:04 2022 -0600

    Use magic numbers to detect xbm files to fix test failures
    
    Updates to GD in version 2.76 caused an existing test related
    to xbm files to start failing. This update fixes the failing
    test.

diff --git a/Graph.pm b/Graph.pm
index 5a3b384..9df4e28 100644
--- a/Graph.pm
+++ b/Graph.pm
@@ -347,7 +347,8 @@ sub _read_logo_file
             pack("H8",'ffd8ffe0') => "jpeg",
             'GIF8' => "gif",
             '.PNG' => "png",
-            '/* X'=> "xpm", # technically '/* XPM */', but I'm hashing, here
+            '/* X' => "xpm", # technically '/* XPM */', but I'm hashing, here
+            '#def' => "xbm",
         );
         if (my $match = $magic{ substr $logodata, 0, 4 }) {
             push @tried, $match;
-----------------------------------------------------------------------


hooks/post-receive
-- 
gdgraph


More information about the Bps-public-commit mailing list