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.

cmd_options.test 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. test_commandlineoptions() {
  3. TEST_LANG=$1
  4. MESSAGE=$2
  5. OPTIONS=$3
  6. EXPECTED=$4
  7. TEST_TEXT=$5
  8. TEST_BROKEN=${6:-false}
  9. if [ "x$MESSAGE" = x- ] ; then
  10. echo "testing ${TEST_LANG}"
  11. else
  12. echo "testing ${TEST_LANG} ($MESSAGE)"
  13. fi
  14. ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
  15. src/espeak-ng ${OPTIONS} -xq -v ${TEST_LANG} "${TEST_TEXT}" > actual.txt
  16. echo "${EXPECTED}" > expected.txt
  17. if [ x$TEST_BROKEN = xbroken ] ; then
  18. diff expected.txt actual.txt || (echo "... ignoring error (broken)" && true)
  19. else
  20. diff expected.txt actual.txt || exit 1
  21. fi
  22. }
  23. ##### Script coverage
  24. # missing tests: -k 10, -a, -d, -g, -p, -s, -w, -b, -z, -pho, -phonout, --punct, --split, --tie, -load
  25. # tested in other tests: --ipa, -x, -X, -v, -m, -f, -q, --compile, --compile-debug, --compile-mbrola, --compile-intonations, --compile-phonemes
  26. test_commandlineoptions en "Capitals (sound)" "-k 1" "_#X1T'aI _#X1'Es Iz a# _#X1t'Es _#X1t'i: fO@ _#X1k'apIt@Lz" "ThiS is a TesT for Capitals"
  27. test_commandlineoptions en "Capitals (word)" "-k 2" "k,ap@-t@L T'aI k,ap@-t@L 'Es Iz a# k,ap@-t@L t'Es k,ap@-t@L t'i: fO@ k,ap@-t@L k'apIt@Lz" "ThiS is a TesT for Capitals"
  28. test_commandlineoptions en "Separator" "--sep=q" "hq@qlq'oU wq'3:qlqd" "hello world"
  29. test_commandlineoptions en "Linelength" "-l 15" "wi:; 'A@
  30. wi:; A@ t'EstIN
  31. wi:; A@ t'EstIN l'aInlENT wi:; A@ t'EstIN l'aInlENT l'aIk D'Is" "We are
  32. We are testing
  33. We are testing linelength
  34. We are testing linelength like this"