summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-x.github/scripts/removemono.sh18
-rw-r--r--.github/workflows/ci_master.yml23
-rw-r--r--src/Makefile.am2
-rw-r--r--src/gd_color_map_test.c27
-rw-r--r--tests/CMakeLists.txt1
-rw-r--r--tests/Makefile.am1
-rw-r--r--tests/gdcolormaplookup/.gitignore1
-rw-r--r--tests/gdcolormaplookup/CMakeLists.txt5
-rw-r--r--tests/gdcolormaplookup/Makemodule.am5
-rw-r--r--tests/gdcolormaplookup/gdcolormaplookup.c24
10 files changed, 71 insertions, 36 deletions
diff --git a/.github/scripts/removemono.sh b/.github/scripts/removemono.sh
new file mode 100755
index 0000000..ebe292f
--- /dev/null
+++ b/.github/scripts/removemono.sh
@@ -0,0 +1,18 @@
+#!/bin/sh -x
+[ "${SUDO_USER}" -a `id -u` -eq 0 ] || {
+ \sudo ${0}
+ \rm -f ${0}
+ exit $?
+}
+\rm -r /Library/Frameworks/Mono.framework
+\rm -r /Library/Receipts/MonoFramework-*
+
+for dir in /usr/bin /usr/share/man/man1 /usr/share/man/man3 /usr/share/man/man5; do
+ (
+ for i in $(\find ${dir} -type l -maxdepth 1 | \grep /Mono.framework/ | \awk '{print $NF}'); do
+ echo \rm ${i}
+ done
+ )
+done
+\rm -f ${0}
+exit 0
diff --git a/.github/workflows/ci_master.yml b/.github/workflows/ci_master.yml
index 119d257..bf3f165 100644
--- a/.github/workflows/ci_master.yml
+++ b/.github/workflows/ci_master.yml
@@ -70,7 +70,7 @@ jobs:
- name: Install macOS dependencies
if: contains(matrix.os, 'macos')
run: |
- brew install libheif libjpeg-turbo freetype libtiff libimagequant libde265 x265 webp
+ brew install libheif libjpeg-turbo libimagequant libde265 x265
- name: Prepare macOS environment
if: contains(matrix.os, 'macos')
@@ -78,11 +78,18 @@ jobs:
sudo xcode-select --switch /Library/Developer/CommandLineTools/
echo "JOBS=$(sysctl -n hw.logicalcpu)" >> $GITHUB_ENV
echo "PKG_CONFIG_PATH=/usr/local/opt/jpeg-turbo/lib/pkgconfig" >> $GITHUB_ENV
- echo "CFLAGS=-I/opt/X11/include" >> $GITHUB_ENV
- echo "CPATH=/usr/local/include:/usr/local/lib:/usr/local/include/libpng16:/usr/local/opt/openssl/include" >> $GITHUB_ENV
- echo "C_INCLUDE_PATH=/usr/local/lib:/usr/local/include/libpng16:/usr/local/opt/openssl/include" >> $GITHUB_ENV
- echo "LIBRARY_PATH=/usr/local/lib:/usr/local/include/libpng:/usr/local/opt/openssl/include" >> $GITHUB_ENV
- echo "LD_PATH"
+ echo "CFLAGS=-I/opt/X11/include -I/usr/local/Cellar/libpng/1.6.37/include/libpng16" >> $GITHUB_ENV
+ echo "LDFLAGS=-L/usr/local/Cellar/libpng/1.6.37/lib" >> $GITHUB_ENV
+ echo "CPATH=/usr/local/include:/usr/local/Cellar/libpng/1.6.37/include/libpng16" >> $GITHUB_ENV
+ echo "C_INCLUDE_PATH=/usr/local/lib:/usr/local/Cellar/libpng/1.6.37/include/libpng16:/usr/local/opt/openssl/include" >> $GITHUB_ENV
+ echo "LIBRARY_PATH=/usr/local/Cellar/libpng/1.6.37/lib:/usr/local/lib" >> $GITHUB_ENV
+ pkg-config --libs --cflags libpng
+ pkg-config --libs libpng
+ pkg-config --libs --cflags libpng16
+ pkg-config --libs libpng16
+ ls /usr/local/Cellar/libpng/1.6.37/
+ ls /usr/local/Cellar/libpng/1.6.37/lib/
+ ${{github.workspace}}/.github/scripts/removemono.sh
- name: Configure CMake MacOS
if: contains(matrix.os, 'macos')
@@ -90,7 +97,7 @@ jobs:
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -DENABLE_PNG=1 -DENABLE_FREETYPE=1 -DENABLE_JPEG=1 -DENABLE_WEBP=1
-DENABLE_TIFF=1 -DENABLE_GD_FORMATS=1 -DENABLE_CPP=0 -DENABLE_HEIF=1 -D CMAKE_PREFIX_PATH=/usr/local
- -DBUILD_TEST=1 -DVERBOSE_MAKEFILE=1 -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
+ -DBUILD_TEST=1 -DVERBOSE_MAKEFILE=1 -DPNG_PNG_INCLUDE_DIR=/usr/local/Cellar/libpng/1.6.37/include -DPNG_PNG_LIBRARY_DIR=/usr/local/Cellar/libpng/1.6.37/lib -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
- name: Install Dependencies Windows
if: contains(matrix.os, 'Windows')
@@ -120,7 +127,7 @@ jobs:
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} --parallel 4
- name: Test Ubuntu
- if: contains(matrix.os, 'ubuntu')
+ if: contains(matrix.os, 'ubuntu') || contains(matrix.os, 'macos')
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
diff --git a/src/Makefile.am b/src/Makefile.am
index 076aabd..dbe9243 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,7 +1,7 @@
## Process this file with automake to produce Makefile.in -*-Makefile-*-
bin_PROGRAMS = gdcmpgif
-check_PROGRAMS = gifanimtest gd_color_map_test
+check_PROGRAMS = gifanimtest
if HAVE_LIBPNG
bin_PROGRAMS += gdtopng pngtogd webpng
diff --git a/src/gd_color_map_test.c b/src/gd_color_map_test.c
deleted file mode 100644
index 26e08bd..0000000
--- a/src/gd_color_map_test.c
+++ /dev/null
@@ -1,27 +0,0 @@
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <stdio.h>
-#include "gd.h"
-#include "gd_color_map.h"
-
-int
-main(void)
-{
- int r, g, b;
- int i;
- for (i=0; i<GD_COLOR_MAP_X11.num_entries; i++) {
- char *color_name = GD_COLOR_MAP_X11.entries[i].color_name;
- if (gdColorMapLookup(GD_COLOR_MAP_X11, color_name, &r, &g, &b)) {
- printf("%s found: #%02x%02x%02x\n", color_name, r, g, b);
- } else {
- fprintf(stderr, "%s not found\n", color_name);
- return 1;
- }
- }
- if (gdColorMapLookup(GD_COLOR_MAP_X11, "no such name", &r, &g, &b)) {
- return 2;
- }
- return 0;
-}
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index d239f49..51f09c4 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -23,6 +23,7 @@ if (BUILD_TEST)
freetype
gd
gd2
+ gdcolormaplookup
gdimagearc
gdimagebrightness
gdimageclone
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 3630810..51177a6 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -19,6 +19,7 @@ include fontconfig/Makemodule.am
include freetype/Makemodule.am
include gd/Makemodule.am
include gd2/Makemodule.am
+include gdcolormaplookup/Makemodule.am
include gdimagearc/Makemodule.am
include gdimagebrightness/Makemodule.am
include gdimageclone/Makemodule.am
diff --git a/tests/gdcolormaplookup/.gitignore b/tests/gdcolormaplookup/.gitignore
new file mode 100644
index 0000000..ace9067
--- /dev/null
+++ b/tests/gdcolormaplookup/.gitignore
@@ -0,0 +1 @@
+/gdcolormaplookup
diff --git a/tests/gdcolormaplookup/CMakeLists.txt b/tests/gdcolormaplookup/CMakeLists.txt
new file mode 100644
index 0000000..e4792a5
--- /dev/null
+++ b/tests/gdcolormaplookup/CMakeLists.txt
@@ -0,0 +1,5 @@
+LIST(APPEND TESTS_FILES
+ gdcolormaplookup
+)
+
+ADD_GD_TESTS()
diff --git a/tests/gdcolormaplookup/Makemodule.am b/tests/gdcolormaplookup/Makemodule.am
new file mode 100644
index 0000000..d31d64b
--- /dev/null
+++ b/tests/gdcolormaplookup/Makemodule.am
@@ -0,0 +1,5 @@
+libgd_test_programs += \
+ gdcolormaplookup/gdcolormaplookup
+
+EXTRA_DIST += \
+ gdcolormaplookup/CMakeLists.txt
diff --git a/tests/gdcolormaplookup/gdcolormaplookup.c b/tests/gdcolormaplookup/gdcolormaplookup.c
new file mode 100644
index 0000000..76cf36b
--- /dev/null
+++ b/tests/gdcolormaplookup/gdcolormaplookup.c
@@ -0,0 +1,24 @@
+/**
+ * Test API gdColorMapLookup defined in gd_color_map.h
+ * Move from src/gd_color_map_test.c
+ */
+
+#include "gd_color_map.h"
+#include "gdtest.h"
+
+int
+main(void)
+{
+ int r, g, b;
+ int i;
+ int ret;
+ for (i=0; i<GD_COLOR_MAP_X11.num_entries; i++) {
+ char *color_name = GD_COLOR_MAP_X11.entries[i].color_name;
+ ret = gdColorMapLookup(GD_COLOR_MAP_X11, color_name, &r, &g, &b);
+ gdTestAssert(ret == 1);
+ }
+ ret = gdColorMapLookup(GD_COLOR_MAP_X11, "no such name", &r, &g, &b);
+ gdTestAssert(ret == 0);
+
+ return gdNumFailures();
+}