cvs: gd /libgd CMakeLists.txt README.TESTING

[email protected] ("Pierre-Alain Joye")
Newsgroups php.gd.cvs
Message-ID <cvspajoye1169596455@cvsserver>
pajoye		Tue Jan 23 23:54:15 2007 UTC

  Added files:                 
    /gd/libgd	CMakeLists.txt README.TESTING 
  Log:
  - initial commit of the GD test suites
    See README.TESTING for more details or how to run it
  

http://cvs.php.net/viewvc.cgi/gd/libgd/CMakeLists.txt?view=markup&rev=1.1
Index: gd/libgd/CMakeLists.txt
+++ gd/libgd/CMakeLists.txt
CMAKE_MINIMUM_REQUIRED(VERSION 2.4.3 FATAL_ERROR)
PROJECT(GD)

SET(CMAKE_MODULE_PATH "${GD_SOURCE_DIR}/cmake/modules")

if (BUILD_TEST)
	ENABLE_TESTING()
endif(BUILD_TEST)

if (USE_EXT_GD)
	message("Using GD at: ${USE_EXT_GD}")
	INCLUDE_DIRECTORIES(BEFORE ${GD_INCLUDE_DIR})
	FIND_PACKAGE(GD)
	if (GD_FOUND)
		INCLUDE_DIRECTORIES(BEFORE ${GD_INCLUDE_DIR})
		LINK_DIRECTORIES(BEFORE ${GD_LIBRARIES})
		SET(GD_LIB ${GD_LIBRARIES})
		SET(GD_LIBS_DIR ${GD_LIBRARY})

		message("GD libs #: ${GD_LIBRARIES}")
		message("GD lib #: ${GD_LIBRARY}")
		message("GD include: ${GD_INCLUDE_DIR}")
	else (GD_FOUND)
		message("No gd found")
	endif (GD_FOUND)
else (USE_EXT_GD)
	SET(GD_VERSION_MAJOR "2")
	SET(GD_VERSION_MINOR "0x0")
	SET(GD_VERSION_PATCH "34")
	SET(GD_VERSION "${GD_VERSION_MAJOR}.${GD_VERSION_MINOR}.${GD_VERSION_PATCH}")
	SET(GD_VERSION_STRING "${GD_VERSION}")

	SET(GD_VERSION_INT "20234")

	SET(PACKAGE GD)
	SET(PACKAGE_NAME GD)

	SET(CMAKE_REQUIRED_INCLUDES "/usr/include" "/usr/local/include")

	message(STATUS "ft2build: ${CMAKE_REQUIRED_INCLUDES}")

	include(CheckIncludeFiles)
	include(CheckIncludeFile)


	include(AC_HEADER_STDC)
	include(CheckPrototypeExists)

	FIND_PACKAGE(PNG REQUIRED)
	FIND_PACKAGE(ZLIB)
	FIND_PACKAGE(JPEG)
	FIND_PACKAGE(PTHREAD)
	FIND_PACKAGE(Freetype)
	FIND_PACKAGE(XPM)
	FIND_PACKAGE(Fontconfig)

	if (FREETYPE_FOUND)
		INCLUDE_DIRECTORIES(${FREETYPE_INCLUDE_DIR})
		message(STATUS "ft2build: ${HAVE_FT2BUILD_H} ${FREETYPE_INCLUDE_DIR}")
		SET(HAVE_FT2BUILD_H 1)
		SET(HAVE_LIBFREETYPE 1)
	ENDIF(FREETYPE_FOUND)

	IF(ZLIB_FOUND)
		INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
		SET(HAVE_LIBZ 1)
		SET(HAVE_LIBPNG_PNG_H 1)
	ENDIF(ZLIB_FOUND)

	IF(PNG_FOUND)
		INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
		SET(HAVE_LIBPNG 1)
	ENDIF(PNG_FOUND)

	IF(XPM_FOUND)
		INCLUDE_DIRECTORIES(${XPM_INCLUDE_DIR})
		SET(HAVE_LIBXPM 1)
	ENDIF(XPM_FOUND)

	IF(JPEG_FOUND)
		INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
		SET(HAVE_LIBJPEG 1)
	ENDIF(JPEG_FOUND)

	IF(FONTCONFIG_FOUND)
		INCLUDE_DIRECTORIES(${FONTCONFIG_INCLUDE_DIR})
		SET(HAVE_LIBFONTCONFIG 1)
	ENDIF(FONTCONFIG_FOUND)

	#FIND_PATH(HAVE_ERRNO_H errno.h)
	#FIND_PATH(HAVE_STRINGS_H strings.h)
	#FIND_PATH(HAVE_LIMITS_H limits.h )
	#SET(HAVE_ERRNO_H 1)
	#SET(HAVE_LIBM 1)
	#FIND_PATH(HAVE_MEMORY_H memory.h)

	#FIND_PATH(HAVE_STRING_H string.h)
	#FIND_PATH(HAVE_SYS_STAT_H 1)
	#FIND_PATH(HAVE_SYS_TYPES_H 1)
	#FIND_PATH(HAVE_UNISTD_H unistd.h)
	#FIND_PATH(STDC_HEADERS 1)
	#FIND_PATH(HAVE_INTTYPES_H 1)
	#FIND_PATH(HAVE_STDDEF_H stddef.h)
	#FIND_PATH(HAVE_STDINT_H 1)
	#FIND_PATH(HAVE_STDLIB_H stdlib.h)

	SET(HAVE_CONFIG_H 1)

	ADD_DEFINITIONS(-DHAVE_CONFIG_H)

	SET (LIBGD_SRC_FILES
		gd.c
		gdfx.c
		gd_security.c
		gd_gd.c
		gd_gd2.c
		gd_io.c
		gd_io_dp.c
		gd_gif_in.c
		gd_gif_out.c
		gd_io_file.c
		gd_io_ss.c
		gd_jpeg.c
		gd_png.c
		gd_ss.c
		gd_topal.c
		gd_wbmp.c
		gdcache.c
		gdfontg.c
		gdfontl.c
		gdfontmb.c
		gdfonts.c
		gdfontt.c
		gdft.c
		gdhelpers.c
		gdhelpers.h
		gdkanji.c
		gdtables.c
		gdxpm.c
		jisx0208.h
		wbmp.c
		wbmp.h
	)

	set(BUILD_SHARED_LIBS On)

	INCLUDE_DIRECTORIES(BEFORE ${GD_SOURCE_DIR}/)

	CONFIGURE_FILE(config.h.cmake config.h ESCAPE_QUOTES)

	add_library(gd ${LIBGD_SRC_FILES})
	target_link_libraries(gd ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${JPEG_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARIES})
	SET(GD_LIB gd)
endif (USE_EXT_GD)

add_subdirectory(tests)
http://cvs.php.net/viewvc.cgi/gd/libgd/README.TESTING?view=markup&rev=1.1
Index: gd/libgd/README.TESTING
+++ gd/libgd/README.TESTING
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

To run the tests suite, all you need is (add the cmake options if you need any
or if the default libs and include paths are not the default) :

$ cmake -DBUILD_TEST=1 .
$ ctest .

If you like to run the tests against a installed GD library, set the following
environment variables:

export CMAKE_INCLUDE_PATH=/path/to/the/gd/include
export CMAKE_LIBRARY_PATH=/path/to/the/gd/lib

then call cmake using:

$ cmake -DUSE_EXT_GD=1 -DBUILD_TEST=1 
$ make
and finally:

$ ctest .

I will certainly add a nice CMake option to give prefix later.

What to do if tests fail on your platform and you use the last GD release? 
either from your favourite distributions or from http://www.libgd.org or cvs?

If you use a packaged version of the GD Library (installed from RPM, deb or 
ports, gentoo packages or any other packages format or distribution), please try
to run the tests using the source releases available at:

http://www.libgd.org/Downloads

If the tests fail using our source release, please report a bug here:

http://bugs.libgd.org

You can attach the two files available in:
./Testing/Temporary

Later versions will have an automatic post mode.

If the tests run successfully, please report a bug to the maintainer of the
packages (debian, bsd, ubuntu or whoever is responsible for the packages).

Reasons of failures:
Exception: SegFault: self explaining
Failed               test failed, check the log to know where
timeout              the default timeout is 5 seconds. Some test may
                     have infinite loops when compiled against old versions
										 of the GD library (esp. 2.0.33 or earlier)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.