diff --git a/tests/bmp/CMakeLists.txt b/tests/bmp/CMakeLists.txt index 5701224..8f2a88f 100644 --- a/tests/bmp/CMakeLists.txt +++ b/tests/bmp/CMakeLists.txt @@ -1,12 +1,12 @@ LIST(APPEND TESTS_FILES bmp_null bug00275 - bug00276 ) IF(PNG_FOUND) LIST(APPEND TESTS_FILES bmp_im2im + bug00276 ) ENDIF(PNG_FOUND) diff --git a/tests/bmp/Makemodule.am b/tests/bmp/Makemodule.am index 27dc7ec..f3f1660 100644 --- a/tests/bmp/Makemodule.am +++ b/tests/bmp/Makemodule.am @@ -1,11 +1,11 @@ libgd_test_programs += \ bmp/bmp_null \ - bmp/bug00275 \ - bmp/bug00276 + bmp/bug00275 if HAVE_LIBPNG libgd_test_programs += \ - bmp/bmp_im2im + bmp/bmp_im2im \ + bmp/bug00276 endif EXTRA_DIST += \ diff --git a/tests/fontconfig/CMakeLists.txt b/tests/fontconfig/CMakeLists.txt index 159130d..f78c4cf 100644 --- a/tests/fontconfig/CMakeLists.txt +++ b/tests/fontconfig/CMakeLists.txt @@ -1,7 +1,9 @@ -IF(FREETYPE_FOUND AND FONTCONFIG_FOUND) +if(FONTCONFIG_FOUND) +IF(FREETYPE_FOUND) LIST(APPEND TESTS_FILES basic ) -ENDIF(FREETYPE_FOUND AND FONTCONFIG_FOUND) +ENDIF(FREETYPE_FOUND) +ENDIF(FONTCONFIG_FOUND) ADD_GD_TESTS() diff --git a/tests/freetype/CMakeLists.txt b/tests/freetype/CMakeLists.txt index a5d8086..9a1e018 100644 --- a/tests/freetype/CMakeLists.txt +++ b/tests/freetype/CMakeLists.txt @@ -1,7 +1,9 @@ IF(FREETYPE_FOUND) +IF(PNG_FOUND) LIST(APPEND TESTS_FILES bug00132 ) +ENDIF(PNG_FOUND) ENDIF(FREETYPE_FOUND) ADD_GD_TESTS() diff --git a/tests/freetype/Makemodule.am b/tests/freetype/Makemodule.am index d252493..312759a 100644 --- a/tests/freetype/Makemodule.am +++ b/tests/freetype/Makemodule.am @@ -1,7 +1,9 @@ if HAVE_LIBFREETYPE +if HAVE_LIBPNG libgd_test_programs += \ freetype/bug00132 endif +endif EXTRA_DIST += \ freetype/CMakeLists.txt \ diff --git a/tests/gdimagefile/CMakeLists.txt b/tests/gdimagefile/CMakeLists.txt index 55ae374..ba48d64 100644 --- a/tests/gdimagefile/CMakeLists.txt +++ b/tests/gdimagefile/CMakeLists.txt @@ -1,5 +1,9 @@ +IF(TIFF_FOUND) +if(WEBP_FOUND) LIST(APPEND TESTS_FILES gdnametest ) +ENDIF(WEBP_FOUND) +ENDIF(TIFF_FOUND) ADD_GD_TESTS() diff --git a/tests/gdimagefile/Makemodule.am b/tests/gdimagefile/Makemodule.am index b537cbc..df86097 100644 --- a/tests/gdimagefile/Makemodule.am +++ b/tests/gdimagefile/Makemodule.am @@ -1,5 +1,9 @@ +if HAVE_LIBTIFF +if HAVE_LIBWEBP libgd_test_programs += \ gdimagefile/gdnametest +endif +endif EXTRA_DIST += \ gdimagefile/CMakeLists.txt \ diff --git a/tests/gdimagerectangle/CMakeLists.txt b/tests/gdimagerectangle/CMakeLists.txt index 2567ae3..e2a2b81 100644 --- a/tests/gdimagerectangle/CMakeLists.txt +++ b/tests/gdimagerectangle/CMakeLists.txt @@ -1,9 +1,14 @@ LIST(APPEND TESTS_FILES bug00003 bug00106_gdimagerectangle - bug00299 github_bug_00172 point_ordering ) +IF(PNG_FOUND) +LIST(APPEND TESTS_FILES + bug00299 +) +ENDIF(PNG_FOUND) + ADD_GD_TESTS() diff --git a/tests/gdimagerectangle/Makemodule.am b/tests/gdimagerectangle/Makemodule.am index ea9d52b..cd49b73 100644 --- a/tests/gdimagerectangle/Makemodule.am +++ b/tests/gdimagerectangle/Makemodule.am @@ -1,10 +1,14 @@ libgd_test_programs += \ gdimagerectangle/bug00003 \ gdimagerectangle/bug00106_gdimagerectangle \ - gdimagerectangle/bug00299 \ gdimagerectangle/github_bug_00172 \ gdimagerectangle/point_ordering +if HAVE_LIBPNG +libgd_test_programs += \ + gdimagerectangle/bug00299 +endif + EXTRA_DIST += \ gdimagerectangle/CMakeLists.txt \ gdimagerectangle/bug00299_exp.png diff --git a/tests/gdimagerotate/CMakeLists.txt b/tests/gdimagerotate/CMakeLists.txt index 29c3573..01957c5 100644 --- a/tests/gdimagerotate/CMakeLists.txt +++ b/tests/gdimagerotate/CMakeLists.txt @@ -1,10 +1,10 @@ +IF(PNG_FOUND) IF(JPEG_FOUND) LIST(APPEND TESTS_FILES bug00067 ) ENDIF(JPEG_FOUND) -IF(PNG_FOUND) LIST(APPEND TESTS_FILES php_bug_64898 php_bug_65070 diff --git a/tests/gdimagerotate/Makemodule.am b/tests/gdimagerotate/Makemodule.am index 99b2398..9d375f3 100644 --- a/tests/gdimagerotate/Makemodule.am +++ b/tests/gdimagerotate/Makemodule.am @@ -1,9 +1,9 @@ +if HAVE_LIBPNG if HAVE_LIBJPEG libgd_test_programs += \ gdimagerotate/bug00067 endif -if HAVE_LIBPNG libgd_test_programs += \ gdimagerotate/php_bug_64898 \ gdimagerotate/php_bug_65070 diff --git a/tests/gdimagesetpixel/CMakeLists.txt b/tests/gdimagesetpixel/CMakeLists.txt index f363899..675bbfd 100644 --- a/tests/gdimagesetpixel/CMakeLists.txt +++ b/tests/gdimagesetpixel/CMakeLists.txt @@ -1,8 +1,13 @@ LIST(APPEND TESTS_FILES - alpha_blending bug00186 gdeffectoverlay gdeffectmultiply ) +IF(PNG_FOUND) +LIST(APPEND TESTS_FILES + alpha_blending +) +ENDIF(PNG_FOUND) + ADD_GD_TESTS() diff --git a/tests/gdimagesetpixel/Makemodule.am b/tests/gdimagesetpixel/Makemodule.am index 0a574ad..1eb0224 100644 --- a/tests/gdimagesetpixel/Makemodule.am +++ b/tests/gdimagesetpixel/Makemodule.am @@ -1,9 +1,13 @@ libgd_test_programs += \ - gdimagesetpixel/alpha_blending \ gdimagesetpixel/bug00186 \ gdimagesetpixel/gdeffectmultiply \ gdimagesetpixel/gdeffectoverlay +if HAVE_LIBPNG +libgd_test_programs += \ + gdimagesetpixel/alpha_blending +endif + EXTRA_DIST += \ gdimagesetpixel/CMakeLists.txt \ gdimagesetpixel/alphablending_exp.png diff --git a/tests/gdimagestringft/CMakeLists.txt b/tests/gdimagestringft/CMakeLists.txt index f46b900..98219f1 100644 --- a/tests/gdimagestringft/CMakeLists.txt +++ b/tests/gdimagestringft/CMakeLists.txt @@ -1,7 +1,9 @@ IF(FREETYPE_FOUND) +IF(PNG_FOUND) LIST(APPEND TESTS_FILES gdimagestringft_bbox ) +ENDIF(PNG_FOUND) ENDIF(FREETYPE_FOUND) ADD_GD_TESTS() diff --git a/tests/gdimagestringft/Makemodule.am b/tests/gdimagestringft/Makemodule.am index 0dfe26f..956e1db 100644 --- a/tests/gdimagestringft/Makemodule.am +++ b/tests/gdimagestringft/Makemodule.am @@ -1,7 +1,9 @@ if HAVE_LIBFREETYPE +if HAVE_LIBPNG libgd_test_programs += \ gdimagestringft/gdimagestringft_bbox endif +endif EXTRA_DIST += \ gdimagestringft/CMakeLists.txt diff --git a/tests/gdtest/gdtest.c b/tests/gdtest/gdtest.c index d173975..26902c5 100644 --- a/tests/gdtest/gdtest.c +++ b/tests/gdtest/gdtest.c @@ -40,6 +40,7 @@ void gdSilence(int priority, const char *format, va_list args) (void)args; } +#ifdef HAVE_LIBPNG gdImagePtr gdTestImageFromPng(const char *filename) { gdImagePtr image; @@ -64,6 +65,7 @@ gdImagePtr gdTestImageFromPng(const char *filename) fclose(fp); return image; } +#endif static char *tmpdir_base; @@ -501,7 +503,7 @@ unsigned int gdMaxPixelDiff(gdImagePtr a, gdImagePtr b) return diff; } - +#ifdef HAVE_LIBPNG int gdTestImageCompareToImage(const char* file, unsigned int line, const char* message, gdImagePtr expected, gdImagePtr actual) { @@ -578,13 +580,15 @@ fail: if (surface_diff) { gdImageDestroy(surface_diff); } - return 0; + return 1; } +#endif +#ifdef HAVE_LIBPNG int gdTestImageCompareToFile(const char* file, unsigned int line, const char* message, const char *expected_file, gdImagePtr actual) { - gdImagePtr expected; + gdImagePtr expected = 0; int res = 1; expected = gdTestImageFromPng(expected_file); @@ -598,7 +602,7 @@ int gdTestImageCompareToFile(const char* file, unsigned int line, const char* me } return res; } - +#endif static int failureCount = 0; diff --git a/tests/jpeg/CMakeLists.txt b/tests/jpeg/CMakeLists.txt index 834a1a0..9ecdc4f 100644 --- a/tests/jpeg/CMakeLists.txt +++ b/tests/jpeg/CMakeLists.txt @@ -1,6 +1,5 @@ IF(JPEG_FOUND) LIST(APPEND TESTS_FILES - bug_github_18 jpeg_empty_file jpeg_im2im jpeg_null @@ -8,6 +7,7 @@ LIST(APPEND TESTS_FILES IF(PNG_FOUND) LIST(APPEND TESTS_FILES + bug_github_18 jpeg_read jpeg_resolution ) diff --git a/tests/jpeg/Makemodule.am b/tests/jpeg/Makemodule.am index bc196b1..43bf89d 100644 --- a/tests/jpeg/Makemodule.am +++ b/tests/jpeg/Makemodule.am @@ -1,12 +1,12 @@ if HAVE_LIBJPEG libgd_test_programs += \ - jpeg/bug_github_18 \ jpeg/jpeg_empty_file \ jpeg/jpeg_im2im \ jpeg/jpeg_null if HAVE_LIBPNG libgd_test_programs += \ + jpeg/bug_github_18 \ jpeg/jpeg_read \ jpeg/jpeg_resolution endif diff --git a/tests/tga/CMakeLists.txt b/tests/tga/CMakeLists.txt index 11542a0..ca191a6 100644 --- a/tests/tga/CMakeLists.txt +++ b/tests/tga/CMakeLists.txt @@ -1,12 +1,17 @@ LIST(APPEND TESTS_FILES - tga_null bug00084 bug00247 bug00247a bug00248 bug00248a heap_overflow - tga_read + tga_null ) +IF(PNG_FOUND) +LIST(APPEND TESTS_FILES + tga_read +) +ENDIF(PNG_FOUND) + ADD_GD_TESTS() diff --git a/tests/tga/Makemodule.am b/tests/tga/Makemodule.am index ab08dbf..091e3be 100644 --- a/tests/tga/Makemodule.am +++ b/tests/tga/Makemodule.am @@ -5,8 +5,12 @@ libgd_test_programs += \ tga/bug00248 \ tga/bug00248a \ tga/heap_overflow \ - tga/tga_null \ + tga/tga_null + +if HAVE_LIBPNG +libgd_test_programs += \ tga/tga_read +endif EXTRA_DIST += \ tga/CMakeLists.txt \ diff --git a/tests/tiff/CMakeLists.txt b/tests/tiff/CMakeLists.txt index 8e542e6..b1ce8a8 100644 --- a/tests/tiff/CMakeLists.txt +++ b/tests/tiff/CMakeLists.txt @@ -4,8 +4,13 @@ LIST(APPEND TESTS_FILES tiff_invalid_read tiff_null tiff_dpi +) + +IF(PNG_FOUND) +LIST(APPEND TESTS_FILES tiff_read_bw ) +ENDIF(PNG_FOUND) ENDIF(TIFF_FOUND) ADD_GD_TESTS() diff --git a/tests/tiff/Makemodule.am b/tests/tiff/Makemodule.am index 2a88d68..a136439 100644 --- a/tests/tiff/Makemodule.am +++ b/tests/tiff/Makemodule.am @@ -3,9 +3,13 @@ libgd_test_programs += \ tiff/tiff_dpi \ tiff/tiff_im2im \ tiff/tiff_invalid_read \ - tiff/tiff_null \ + tiff/tiff_null + +if HAVE_LIBPNG +libgd_test_programs += \ tiff/tiff_read_bw endif +endif EXTRA_DIST += \ tiff/CMakeLists.txt \ diff --git a/tests/xbm/CMakeLists.txt b/tests/xbm/CMakeLists.txt index 2c8c9e9..3e3bb69 100644 --- a/tests/xbm/CMakeLists.txt +++ b/tests/xbm/CMakeLists.txt @@ -1,7 +1,9 @@ +IF(PNG_FOUND) LIST(APPEND TESTS_FILES github_bug_109 github_bug_170 x10_basic_read ) +ENDIF(PNG_FOUND) ADD_GD_TESTS() diff --git a/tests/xbm/Makemodule.am b/tests/xbm/Makemodule.am index 86a0837..a9a293d 100644 --- a/tests/xbm/Makemodule.am +++ b/tests/xbm/Makemodule.am @@ -1,7 +1,9 @@ +if HAVE_LIBPNG libgd_test_programs += \ xbm/github_bug_109 \ xbm/github_bug_170 \ xbm/x10_basic_read +endif EXTRA_DIST += \ xbm/CMakeLists.txt \