[sword-svn] r3758 - in trunk: . cmake tests tests/testsuite

greg.hellings at crosswire.org greg.hellings at crosswire.org
Fri Jul 24 23:51:17 EDT 2020


Author: greg.hellings
Date: 2020-07-24 23:51:17 -0400 (Fri, 24 Jul 2020)
New Revision: 3758

Modified:
   trunk/CMakeLists.txt
   trunk/cmake/install.cmake
   trunk/cmake/muxsources.cmake
   trunk/tests/CMakeLists.txt
   trunk/tests/testsuite/CMakeLists.txt
Log:
Small tweaks to CMake build

Use standard ICU variables to be sure we don't miss any libraries
Move test run to CTest instead of manual run
Clean older CMake parts


Modified: trunk/CMakeLists.txt
===================================================================
--- trunk/CMakeLists.txt	2020-07-24 17:38:34 UTC (rev 3757)
+++ trunk/CMakeLists.txt	2020-07-25 03:51:17 UTC (rev 3758)
@@ -241,7 +241,7 @@
 	IF("${ICU_VERSION}" VERSION_GREATER "61")
 		ADD_DEFINITIONS(-DU_USING_ICU_NAMESPACE)
 	ENDIF("${ICU_VERSION}" VERSION_GREATER "61")
-	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${ICU_LIBRARIES})
+	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${ICU_LIBRARY})
 ENDIF(WITH_ICU)
 IF(REGEX_FOUND AND CROSS_COMPILE_MINGW32)
 	SET(SWORD_LINK_LIBRARIES ${SWORD_LINK_LIBRARIES} ${REGEX_LIBRARY})
@@ -318,6 +318,7 @@
 ##############################################################################################
 # Tests, however, are not
 
-IF(SWORD_BUILD_TESTS STREQUAL "Yes")
+IF(SWORD_BUILD_TESTS)
+	INCLUDE(CTest)
 	ADD_SUBDIRECTORY("${CMAKE_CURRENT_SOURCE_DIR}/tests")
-ENDIF(SWORD_BUILD_TESTS STREQUAL "Yes")
+ENDIF(SWORD_BUILD_TESTS)

Modified: trunk/cmake/install.cmake
===================================================================
--- trunk/cmake/install.cmake	2020-07-24 17:38:34 UTC (rev 3757)
+++ trunk/cmake/install.cmake	2020-07-25 03:51:17 UTC (rev 3758)
@@ -45,7 +45,7 @@
 	SET(CLUCENE_LIBS	${CLUCENE_LIBRARY})
 ENDIF(WITH_CLUCENE)
 IF(WITH_ICU)
-	SET(ICU_LIBS	"${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES}")
+	SET(ICU_LIBS	${ICU_LIBRARY})
 ENDIF(WITH_ICU)
 
 IF(LIBSWORD_LIBRARY_TYPE STREQUAL "Static")

Modified: trunk/cmake/muxsources.cmake
===================================================================
--- trunk/cmake/muxsources.cmake	2020-07-24 17:38:34 UTC (rev 3757)
+++ trunk/cmake/muxsources.cmake	2020-07-25 03:51:17 UTC (rev 3758)
@@ -90,12 +90,12 @@
 # ICU needs some lovin' too
 IF(ICU_FOUND AND NOT SWORD_NO_ICU)
 	MESSAGE(STATUS "ICU: yes ${ICU_LIBRARY} and ${ICU_INCLUDE_DIRS}")
-	ADD_DEFINITIONS(-D_ICU_)
+	ADD_DEFINITIONS(-D_ICU_ -DUSEICUREGEX)
 	SET(sword_SOURCES ${sword_SOURCES} ${sword_icu_found_SOURCES})
-	SET(WITH_ICU 1)
+	SET(WITH_ICU TRUE)
 ELSE()
 	MESSAGE(STATUS "ICU: no")
-	SET(WITH_ICU 0)
+	SET(WITH_ICU FALSE)
 ENDIF()
 
 # Internal or external regex.h

Modified: trunk/tests/CMakeLists.txt
===================================================================
--- trunk/tests/CMakeLists.txt	2020-07-24 17:38:34 UTC (rev 3757)
+++ trunk/tests/CMakeLists.txt	2020-07-25 03:51:17 UTC (rev 3758)
@@ -1,16 +1,5 @@
 #########################################################################################
 # A test suite - that is awesome.
-#
-# I should probably learn the proper usage of such things as CTest for this, but for the
-# time being, I'll see what I can do.
-# 
-#
-# I need some help deciphering tests/cppunit/Makefile.am.  I'm not quite sure what it is
-# trying to do in there.
-# Also, the contents of the tests/testsuite directory are slightly beyond my knowledge
-# level.  It looks like I can do a very simple interface to this all, but I need to know
-# more about how these tests work.
-# 
 
 MESSAGE(STATUS "\n-- CONFIGURING LIBRARY TESTS")
 
@@ -53,7 +42,7 @@
 	SET(test_PROGRAMS
 		${test_PROGRAMS}
 		icutest
-#		tlitmgrtest
+		tlitmgrtest
 		translittest
 	)
 ENDIF(WITH_ICU)
@@ -66,7 +55,7 @@
 ENDIF(WITH_ZLIB OR WITH_INTERNAL_ZLIB)
 
 FOREACH(TEST ${test_PROGRAMS})
-	ADD_EXECUTABLE(${TEST} EXCLUDE_FROM_ALL	${TEST}.cpp)
+	ADD_EXECUTABLE(${TEST} ${TEST}.cpp)
 	IF(BUILDING_SHARED)
 		TARGET_LINK_LIBRARIES(${TEST}	sword)
 	ELSE(BUILDING_SHARED)
@@ -78,8 +67,8 @@
 # The following tests require extra libraries to run
 #
 IF(WITH_ICU)
-	FOREACH(ICUTEST icutest translittest)
-		TARGET_LINK_LIBRARIES(${ICUTEST} ${ICU_LIBRARIES} ${ICU_I18N_LIBRARIES})
+	FOREACH(ICUTEST icutest translittest tlitmgrtest)
+        TARGET_LINK_LIBRARIES(${ICUTEST} ${ICU_LIBRARY})
 	ENDFOREACH(ICUTEST icutest translittest)
 ENDIF(WITH_ICU)
 

Modified: trunk/tests/testsuite/CMakeLists.txt
===================================================================
--- trunk/tests/testsuite/CMakeLists.txt	2020-07-24 17:38:34 UTC (rev 3757)
+++ trunk/tests/testsuite/CMakeLists.txt	2020-07-25 03:51:17 UTC (rev 3758)
@@ -14,14 +14,17 @@
 	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
 )
 
-ADD_CUSTOM_TARGET(
-	tests
-	COMMAND ./runall.sh
-	WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
-)
+FILE(GLOB TEST_SUITE RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" "*.good")
+FOREACH(TEST ${TEST_SUITE})
+	GET_FILENAME_COMPONENT(TEST_NAME "${TEST}" NAME_WE)
+	ADD_TEST(NAME "${TEST_NAME}"
+		WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}"
+		COMMAND ./runtest.sh "${TEST_NAME}")
+	MESSAGE(STATUS "  Adding test ${TEST_NAME}")
+ENDFOREACH(TEST ${TEST_SUITE})
 
 ADD_DEPENDENCIES(
-	tests
+	buildtest
 	tests_configure
 )
 



More information about the sword-cvs mailing list