Add phoneme output tests.

This commit is contained in:
Reece H. Dunn
2017-11-04 08:26:48 +00:00
parent 50a2d8e291
commit 6043d35c72
3 changed files with 25 additions and 0 deletions
+1
View File
@@ -98,6 +98,7 @@ src/speak-ng
tests/*.test
!tests/languages.test
!tests/phoneme-output.test
espeak-ng.pc
+1
View File
@@ -250,6 +250,7 @@ tests_api_test_SOURCES = tests/api.c
check: tests/encoding.check \
tests/readclause.check \
tests/api.check \
tests/phoneme-output.check \
tests/languages.check
##### phoneme data:
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
test_phonemes() {
TEST_LANG=$1
EXPECTED=$2
TEST_TEXT=$3
echo "testing ${TEST_LANG} \"${TEST_TEXT}\""
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
src/espeak-ng -xq -v ${TEST_LANG} "${TEST_TEXT}" > actual.txt
echo "${EXPECTED}" > expected.txt
diff expected.txt actual.txt || exit 1
}
# word lookup
test_phonemes en " h@l'oU" "hello"
# correct word stress
test_phonemes en " s'VmTIN Imp'o@t@nt" "something important"
# spelling rules for suffices (-mas, -mu)
test_phonemes lv " nev'ie:na no\`_ 'eiRo:pas v'a>lsti:m nek,ad nav p'a:Rga:jusi no\`_ 'univERsa::la:s_:_: no\` visp'aRe:jiem n'uoduok}l^iem f'inansE:tas_:_: s'iste:mas uz 'obliga:ta:s 'apdRuoSina:Sanas s'iste:mu b'eigas" "Neviena no Eiropas valstīm nekad nav pārgājusi no universālās (no visparējiem nodokļiem finansētas) sistēmas uz obligātās apdrošināšanas sistēmu Beigas."