diff options
author | Mike Frysinger <vapier@gentoo.org> | 2016-07-21 20:25:29 +0530 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2016-07-21 20:25:29 +0530 |
commit | 7d04b45481f73d58a2c15e90167ae4ab46c7b541 (patch) | |
tree | dc8b6c3b3d0d1f24e45bd354c46f3e07814510a3 | |
parent | b0333689ef53c16c2f5313f5e97ba81d91576256 (diff) | |
download | libgd-7d04b45481f73d58a2c15e90167ae4ab46c7b541.tar.gz |
tests: drop test_config.h
This header provides a single define: GDTEST_TOP_DIR. Move it to the
build CPPFLAGS instead since it's a path var and that's the recommended
way of handling these (by autotools standards), and it simplifies the
build overall. It also harmonizes the autotool & cmake build paths.
We localize this define to the gdtest/ subdir as we don't want any of
the other tests using the path. We have gdtest helpers instead.
-rw-r--r-- | configure.ac | 1 | ||||
-rw-r--r-- | tests/.gitignore | 2 | ||||
-rw-r--r-- | tests/Makefile.am | 3 | ||||
-rw-r--r-- | tests/gdimagefile/gdnametest.c | 1 | ||||
-rw-r--r-- | tests/gdtest/CMakeLists.txt | 3 | ||||
-rw-r--r-- | tests/gdtest/Makemodule.am | 3 | ||||
-rw-r--r-- | tests/gdtest/gdtest.c | 1 | ||||
-rw-r--r-- | tests/gdtest/gdtest.h | 1 | ||||
-rw-r--r-- | tests/gdtest/test_config.h.cmake | 4 | ||||
-rw-r--r-- | tests/test_config.h.in | 7 |
10 files changed, 4 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac index 360516a..abfb59a 100644 --- a/configure.ac +++ b/configure.ac @@ -333,7 +333,6 @@ AC_MSG_RESULT([ AC_CONFIG_FILES([Makefile src/Makefile tests/Makefile - tests/test_config.h config/Makefile config/gdlib-config config/gdlib.pc]) diff --git a/tests/.gitignore b/tests/.gitignore index 9422fc4..7e563b8 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,4 +1,2 @@ *.log *.trs - -/test_config.h diff --git a/tests/Makefile.am b/tests/Makefile.am index afdcd5d..21cfb0d 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -4,6 +4,7 @@ libgdtest_a_SOURCES = \ gdtest/gdtest.c \ gdtest/gdtest.h \ gdhelpers.c +libgdtest_a_CPPFLAGS = $(AM_CPPFLAGS) -DGDTEST_TOP_DIR='"$(srcdir)"' # Setup vars that subdirs will increment. libgd_test_programs = @@ -63,7 +64,7 @@ include xbm/Makemodule.am include xpm/Makemodule.am LDADD = libgdtest.a ../src/libgd.la -AM_CPPFLAGS = -I$(top_srcdir)/src -I $(top_srcdir)/tests/gdtest +AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/tests/gdtest check_PROGRAMS = $(libgd_test_programs) $(libgd_helper_programs) TESTS += $(libgd_test_programs) diff --git a/tests/gdimagefile/gdnametest.c b/tests/gdimagefile/gdnametest.c index 40dbc30..eef561a 100644 --- a/tests/gdimagefile/gdnametest.c +++ b/tests/gdimagefile/gdnametest.c @@ -4,7 +4,6 @@ #include "gd.h" #include "gdtest.h" -#include "test_config.h" #define WIDTH 60 #define HEIGHT 50 diff --git a/tests/gdtest/CMakeLists.txt b/tests/gdtest/CMakeLists.txt index 5f89bc9..4b05262 100644 --- a/tests/gdtest/CMakeLists.txt +++ b/tests/gdtest/CMakeLists.txt @@ -1,4 +1,3 @@ -SET(GDTEST_TOP_DIR "${GD_SOURCE_DIR}/tests") -CONFIGURE_FILE(test_config.h.cmake test_config.h ESCAPE_QUOTES) +add_definitions(-DGDTEST_TOP_DIR="${CMAKE_CURRENT_SOURCE_DIR}/..") add_library (gdTest STATIC gdtest.c) target_link_libraries(gdTest ${GD_LIB}) diff --git a/tests/gdtest/Makemodule.am b/tests/gdtest/Makemodule.am index 5b4e39e..a68842e 100644 --- a/tests/gdtest/Makemodule.am +++ b/tests/gdtest/Makemodule.am @@ -1,5 +1,4 @@ # Note: Library is declared in tests/Makefile.am as it's used by all the tests. EXTRA_DIST += \ - gdtest/CMakeLists.txt \ - gdtest/test_config.h.cmake + gdtest/CMakeLists.txt diff --git a/tests/gdtest/gdtest.c b/tests/gdtest/gdtest.c index 93fb6e6..a75e101 100644 --- a/tests/gdtest/gdtest.c +++ b/tests/gdtest/gdtest.c @@ -27,7 +27,6 @@ #include "gd.h" #include "gdtest.h" -#include "test_config.h" /* max is already defined in windows/msvc */ #ifndef max diff --git a/tests/gdtest/gdtest.h b/tests/gdtest/gdtest.h index c831c10..e6cb2c5 100644 --- a/tests/gdtest/gdtest.h +++ b/tests/gdtest/gdtest.h @@ -2,7 +2,6 @@ #define GD_TEST_H #include <stdarg.h> -#include "test_config.h" typedef struct CuTestImageResult CuTestImageResult; struct CuTestImageResult { diff --git a/tests/gdtest/test_config.h.cmake b/tests/gdtest/test_config.h.cmake deleted file mode 100644 index 59d2f0c..0000000 --- a/tests/gdtest/test_config.h.cmake +++ /dev/null @@ -1,4 +0,0 @@ -/* Define the full path to the top src dir, required to get the path - * of each input data */ -#cmakedefine GDTEST_TOP_DIR "@GDTEST_TOP_DIR@" - diff --git a/tests/test_config.h.in b/tests/test_config.h.in deleted file mode 100644 index 78a6588..0000000 --- a/tests/test_config.h.in +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef GD_TEST_CONFIG_H -#define GD_TEST_CONFIG_H -/* Define the full path to the top src dir, required to get the path - * of each input data */ -#define GDTEST_TOP_DIR "@srcdir@" -#endif - |