20193442 gd2 should hook up its tests
authorRich Burridge <rich.burridge@oracle.com>
Thu, 11 Dec 2014 09:07:58 -0800
changeset 3536 9d36b040ae85
parent 3534 75e5dba8a315
child 3537 d6e978572053
20193442 gd2 should hook up its tests
components/gd2/Makefile
components/gd2/patches/005-fix-tests.patch
--- a/components/gd2/Makefile	Wed Dec 10 16:42:57 2014 -0800
+++ b/components/gd2/Makefile	Thu Dec 11 09:07:58 2014 -0800
@@ -50,6 +50,10 @@
 CFLAGS += $(CPP_LARGEFILES)
 CPPFLAGS += $(CPP_LARGEFILES)
 
+# Needed for "gmake test" to work.
+COMPONENT_PRE_CONFIGURE_ACTION = \
+	($(CLONEY) $(SOURCE_DIR) $(@D))
+
 CONFIGURE_ENV += CFLAGS="$(CFLAGS)"
 CONFIGURE_ENV += CPPFLAGS="$(CPPFLAGS)"
 CONFIGURE_ENV += PKG_CONFIG_PATH="$(PKG_CONFIG_PATH_$(BITS))"
@@ -62,6 +66,12 @@
 
 COMPONENT_PREP_ACTION = (cd $(@D) ; autoreconf -if)
 
+COMPONENT_TEST_CMD = \
+	cmake -DBUILD_TEST=1 .; \
+	(cd $(@D)/tests; gmake); \
+	ctest .
+COMPONENT_TEST_TARGETS =
+
 ASLR_MODE = $(ASLR_ENABLE)
 
 configure:	$(CONFIGURE_32_and_64)
@@ -70,10 +80,7 @@
 
 install: $(INSTALL_32_and_64)
 
-test: 	$(NO_TESTS)
-	@echo "There is no test harness for libgd2."
-	@echo "Test programs must be run manually and their output"
-	@echo "should be visually inspected."
+test:	$(TEST_32_and_64)
 
 BUILD_PKG_DEPENDENCIES = $(BUILD_TOOLS)
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gd2/patches/005-fix-tests.patch	Thu Dec 11 09:07:58 2014 -0800
@@ -0,0 +1,15 @@
+Changes needed to get gd2 tests working.
+
+This change needs to be further evaluated to see if it should be passed
+upstream.
+
+--- tests/gdimageline/CMakeLists.txt.orig	2014-12-10 16:08:04.845700212 -0800
++++ tests/gdimageline/CMakeLists.txt	2014-12-10 16:07:38.129451205 -0800
+@@ -7,6 +7,6 @@
+ 
+ FOREACH(test_name ${TESTS_FILES})
+ 	add_executable(${test_name} "${test_name}.c")
+-	target_link_libraries (${test_name} gdTest ${GD_LIB})
++	target_link_libraries (${test_name} gdTest ${GD_LIB} "-lm")
+ 	ADD_TEST(${test_name} ${EXECUTABLE_OUTPUT_PATH}/${test_name})
+ ENDFOREACH(test_name)