TDE personal information management applications
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

82 lines
2.5 KiB

  1. #################################################
  2. #
  3. # (C) 2019 Michele Calgaro
  4. # michele (DOT) calgaro (AT) yahoo (DOT) it
  5. #
  6. # Improvements and feedbacks are welcome
  7. #
  8. # This file is released under GPL >= 3
  9. #
  10. #################################################
  11. include_directories(
  12. ${TQT_INCLUDE_DIRS}
  13. ${TDE_INCLUDE_DIR}
  14. ${CMAKE_SOURCE_DIR}
  15. ${CMAKE_BINARY_DIR}
  16. ${CMAKE_CURRENT_SOURCE_DIR}
  17. ${CMAKE_CURRENT_BINARY_DIR}
  18. ${CMAKE_SOURCE_DIR}/libkcal
  19. ${CMAKE_SOURCE_DIR}/libtdepim
  20. )
  21. set( _link_libkcal_tests
  22. ${TQT_LIBRARIES}
  23. DCOP-shared
  24. tdecore-shared
  25. tdeui-shared
  26. tdefx-shared
  27. tdeio-shared
  28. tdetexteditor-shared
  29. kcal-shared
  30. )
  31. ### executable files
  32. set( _test_executables
  33. fbrecurring readandwrite testcalendar testcalselectdialog testfb testfields testincidence testrecurprevious
  34. testrecurrence testrecurrencetype testrecurson testresource testtostring testvcalexport
  35. )
  36. foreach( _test_name ${_test_executables} )
  37. tde_add_check_executable( ${_test_name}
  38. SOURCES ${_test_name}.cpp AUTOMOC
  39. LINK ${_link_libkcal_tests}
  40. )
  41. endforeach( )
  42. set_target_properties( testfields
  43. PROPERTIES COMPILE_FLAGS -DINPUT='\"${CMAKE_CURRENT_SOURCE_DIR}/data/test_pilot.ics\"'
  44. )
  45. ### tests
  46. add_custom_command(
  47. TARGET fbrecurring PRE_BUILD
  48. COMMAND test -d data || cp -vr ${CMAKE_CURRENT_SOURCE_DIR}/data data
  49. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
  50. )
  51. set ( _test1 testrecurrence "next" ${CMAKE_CURRENT_SOURCE_DIR}/data/RecurrenceRule/*.ics )
  52. set ( _test2 testrecurprevious "prev" ${CMAKE_CURRENT_SOURCE_DIR}/data/RecurrenceRule/*.ics )
  53. set ( _test3 testrecurson "recurson" ${CMAKE_CURRENT_SOURCE_DIR}/data/RecurrenceRule/*.ics )
  54. set ( _test4 readandwrite "ical" ${CMAKE_CURRENT_SOURCE_DIR}/data/Compat/*.ics )
  55. set ( _test5 testvcalexport "vcal" ${CMAKE_CURRENT_SOURCE_DIR}/data/vCalendar/*.ics )
  56. set ( _test6 readandwrite "ical" ${CMAKE_CURRENT_SOURCE_DIR}/data/vCalendar/*.vcs )
  57. set ( _all_tests _test1 _test2 _test3 _test4 _test5 _test6 )
  58. foreach( _test_name ${_all_tests} )
  59. list( GET ${_test_name} 0 _test_executable )
  60. list( GET ${_test_name} 1 _test_id )
  61. list( GET ${_test_name} 2 _test_search_filter )
  62. file( GLOB_RECURSE _test_files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${_test_search_filter} )
  63. foreach( _test_file ${_test_files} )
  64. add_test(
  65. ${_test_executable}__${_test_file}__
  66. ${CMAKE_CURRENT_SOURCE_DIR}/runtestcase.pl ${_test_executable} ${_test_id} ${CMAKE_CURRENT_BINARY_DIR}/${_test_file}
  67. )
  68. endforeach( )
  69. endforeach( )