eSpeak NG is an open source speech synthesizer that supports more than hundred languages and accents.
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.

CMakeLists.txt 1.8KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. include(CTest)
  2. list(APPEND _binary_tests)
  3. macro(compiled_test _test_name)
  4. add_executable(test_${_test_name}
  5. $<TARGET_OBJECTS:espeak-ng>
  6. ${_test_name}.c
  7. )
  8. target_link_libraries(test_${_test_name} PRIVATE
  9. $<TARGET_PROPERTY:espeak-ng,LINK_LIBRARIES>
  10. )
  11. target_include_directories(
  12. test_${_test_name} PRIVATE
  13. $<TARGET_PROPERTY:espeak-ng,SOURCE_DIR>
  14. $<TARGET_PROPERTY:espeak-ng,SOURCE_DIR>/include/compat
  15. $<TARGET_PROPERTY:espeak-ng,INTERFACE_INCLUDE_DIRECTORIES>
  16. $<TARGET_PROPERTY:espeak-ng-config,INTERFACE_INCLUDE_DIRECTORIES>
  17. )
  18. add_dependencies(test_${_test_name} data)
  19. add_test(
  20. NAME ${_test_name}
  21. COMMAND ${ESPEAK_RUN_ENV} $<TARGET_FILE:test_${_test_name}>
  22. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
  23. )
  24. list(APPEND _binary_tests test_${_test_name})
  25. endmacro(compiled_test)
  26. find_program(SHELL bash)
  27. macro(shell_test _test_name)
  28. add_test(
  29. NAME ${_test_name}
  30. COMMAND ${ESPEAK_RUN_ENV} ESPEAK_BIN=$<TARGET_FILE:espeak-ng-bin> ${SHELL} ${CMAKE_CURRENT_SOURCE_DIR}/${_test_name}.test
  31. WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/..
  32. )
  33. endmacro(shell_test)
  34. compiled_test(api)
  35. compiled_test(encoding)
  36. compiled_test(ieee80)
  37. compiled_test(readclause)
  38. if (SHELL AND UNIX)
  39. shell_test(bom)
  40. shell_test(non-executable-files-with-executable-bit)
  41. shell_test(cmd_options)
  42. shell_test(dictionary)
  43. shell_test(language-numbers-cardinal)
  44. shell_test(language-numbers-ordinal)
  45. shell_test(language-phonemes)
  46. shell_test(language-pronunciation)
  47. shell_test(language-replace)
  48. shell_test(ssml)
  49. shell_test(translate)
  50. shell_test(variants)
  51. shell_test(voices)
  52. # shell_test(windows-data)
  53. # shell_test(windows-installer)
  54. if (USE_KLATT)
  55. shell_test(klatt)
  56. endif()
  57. if (USE_MBROLA)
  58. shell_test(mbrola)
  59. endif()
  60. endif()
  61. add_custom_target(tests DEPENDS ${_binary_tests})