From 6043d35c720efdafc7338f5ea65ad64f7d49c942 Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 4 Nov 2017 08:26:48 +0000 Subject: [PATCH] Add phoneme output tests. --- .gitignore | 1 + Makefile.am | 1 + tests/phoneme-output.test | 23 +++++++++++++++++++++++ 3 files changed, 25 insertions(+) create mode 100755 tests/phoneme-output.test diff --git a/.gitignore b/.gitignore index ab5fcdf8..36d797e3 100644 --- a/.gitignore +++ b/.gitignore @@ -98,6 +98,7 @@ src/speak-ng tests/*.test !tests/languages.test +!tests/phoneme-output.test espeak-ng.pc diff --git a/Makefile.am b/Makefile.am index 0ae0c326..427083de 100644 --- a/Makefile.am +++ b/Makefile.am @@ -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: diff --git a/tests/phoneme-output.test b/tests/phoneme-output.test new file mode 100755 index 00000000..a75c4e82 --- /dev/null +++ b/tests/phoneme-output.test @@ -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." +