Warning, /office/calligraplan/tests/CMakeLists.txt is written in an unsupported language. File is not indexed.
0001 0002 ## Some tests do not work on freeBSD, so disable these tests until we found out why 0003 STRING (REGEX MATCH "BSD" OS_BSD ${CMAKE_SYSTEM_NAME}) 0004 if (OS_BSD) 0005 message (WARNING "OS is ${CMAKE_SYSTEM_NAME}. i18n tests are disabled.") 0006 endif() 0007 0008 ###### Add i18n unit tests ############# 0009 0010 find_program(BASH_PROGRAM bash) 0011 find_program(XGETTEXT_PROGRAM xgettext) 0012 find_program(MSGCAT_PROGRAM msgcat) 0013 0014 if (BASH_PROGRAM AND XGETTEXT_PROGRAM AND MSGCAT_PROGRAM) 0015 macro(PLAN_ADD_TEST_COMMAND _TEST_NAME) 0016 add_test("plan-${_TEST_NAME}" ${BASH_PROGRAM} "${CMAKE_CURRENT_SOURCE_DIR}/${_TEST_NAME}.sh" 0017 "${PROJECT_SOURCE_DIR}/kundo2_aware_xgettext.sh" 0018 "${XGETTEXT_PROGRAM}" 0019 "${MSGCAT_PROGRAM}" 0020 "${CMAKE_CURRENT_BINARY_DIR}/po" 0021 ) 0022 endmacro() 0023 macro(PLAN_ADD_UNIT_TEST _TEST_NAME) 0024 add_custom_target(Plan${_TEST_NAME} ALL 0025 COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/${_TEST_NAME}.cpp" "${CMAKE_CURRENT_BINARY_DIR}/${_TEST_NAME}.cpp" 0026 COMMENT "Copy test files" VERBATIM 0027 ) 0028 PLAN_ADD_TEST_COMMAND(${_TEST_NAME}) 0029 endmacro() 0030 0031 # create the podir 0032 add_custom_target(Planpodir ALL 0033 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR}/po 0034 COMMENT "Create podir" VERBATIM) 0035 # copy parameters script 0036 add_custom_target(Planparameters ALL 0037 COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/parameters.sh ${CMAKE_CURRENT_BINARY_DIR}/parameters.sh 0038 COMMENT "Copy parameters script" VERBATIM) 0039 0040 # add tests here 0041 if (NOT OS_BSD) 0042 PLAN_ADD_UNIT_TEST(test_i18n) 0043 PLAN_ADD_UNIT_TEST(test_i18nc) 0044 PLAN_ADD_UNIT_TEST(test_i18nc_long) 0045 0046 PLAN_ADD_UNIT_TEST(test_i18np) 0047 PLAN_ADD_UNIT_TEST(test_i18n_noop) 0048 PLAN_ADD_UNIT_TEST(test_i18n_noop2) 0049 0050 PLAN_ADD_UNIT_TEST(test_xi18n) 0051 PLAN_ADD_UNIT_TEST(test_xi18nc) 0052 PLAN_ADD_UNIT_TEST(test_xi18nc_long) 0053 PLAN_ADD_UNIT_TEST(test_xi18np) 0054 PLAN_ADD_UNIT_TEST(test_xi18ncp) 0055 0056 PLAN_ADD_UNIT_TEST(test_kundo2_i18n) 0057 PLAN_ADD_UNIT_TEST(test_kundo2_i18nc) 0058 PLAN_ADD_UNIT_TEST(test_kundo2_i18nc_long) 0059 0060 # this uses cpp files from earlier tests 0061 PLAN_ADD_TEST_COMMAND(test_i18n_mixed) 0062 0063 # add test of Messages.sh 0064 add_test(test_Messages ${BASH_PROGRAM} "${CMAKE_CURRENT_SOURCE_DIR}/test_messages.sh" "${PROJECT_SOURCE_DIR}") 0065 endif(NOT OS_BSD) 0066 endif()