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.

variants.test 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. # Test a command for presence and ability to output the sha1 hash of a file.
  3. check_hashcmd() {
  4. which $1 &&
  5. $1 </dev/null 2>/dev/null |
  6. awk '{if ($1 != "da39a3ee5e6b4b0d3255bfef95601890afd80709") { exit 1; }}'
  7. }
  8. # Test some common commands to find the correct one for the system being tested on.
  9. echo -n "checking for SHA1 hashing command ... "
  10. if check_hashcmd sha1sum; then
  11. sha1sum=sha1sum
  12. elif check_hashcmd sha1; then
  13. sha1sum=sha1
  14. elif check_hashcmd shasum; then
  15. sha1sum=shasum
  16. else
  17. echo "no"
  18. exit 1
  19. fi
  20. test_variants() {
  21. TEST_LANG=$1
  22. EXPECTED=$2
  23. TEST_TEXT=$3
  24. echo "testing ${TEST_LANG}"
  25. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  26. src/espeak-ng --stdout -v ${TEST_LANG} "${TEST_TEXT}" | \
  27. $sha1sum | awk '{ print $1 }' > actual.txt
  28. echo "${EXPECTED}" > expected.txt
  29. diff expected.txt actual.txt || exit 1
  30. }
  31. test_variants "en" 029983e9084e04384af8a0816fb667e5c5e06389 "Testing variants"
  32. # variant doesn't exist, should be equal to en:
  33. test_variants "en+nonexisting" 029983e9084e04384af8a0816fb667e5c5e06389 "Testing variants"
  34. test_variants "en+f1" dba359ac75ec33cc9cd4bd2af5031a3dbd84427c "Testing variants"
  35. test_variants "en+anikaRobot" d56012d8f4cfb4c36fdad31ad9ad7abda40ef474 "Testing variants"