diff --git a/.gitignore b/.gitignore index 145e4cf1..617d6282 100644 --- a/.gitignore +++ b/.gitignore @@ -100,6 +100,7 @@ tests/*.test !tests/languages.test !tests/phoneme-output.test !tests/phoneme-audio.test +!tests/ssml.test espeak-ng.pc diff --git a/Makefile.am b/Makefile.am index c2d5851b..28c39f87 100644 --- a/Makefile.am +++ b/Makefile.am @@ -252,6 +252,7 @@ check: tests/encoding.check \ tests/api.check \ tests/phoneme-output.check \ tests/phoneme-audio.check \ + tests/ssml.check \ tests/languages.check ##### phoneme data: diff --git a/tests/ssml.test b/tests/ssml.test new file mode 100755 index 00000000..37504383 --- /dev/null +++ b/tests/ssml.test @@ -0,0 +1,13 @@ +#!/bin/sh + +test_ssml() { + INPUT=$1 + echo "testing ${INPUT}" + cp $(dirname $INPUT)/$(basename ${INPUT%.*}).expected expected.txt + ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \ + src/espeak-ng -m -v en-US --ipa=2 -f ${INPUT} > actual.txt + diff expected.txt actual.txt || exit 1 +} + +for i in `ls tests/ssml/*.ssml` ; do test_ssml $i ; done + diff --git a/tests/ssml/billion-laughs.expected b/tests/ssml/billion-laughs.expected new file mode 100644 index 00000000..18c59b5b --- /dev/null +++ b/tests/ssml/billion-laughs.expected @@ -0,0 +1,3 @@ + lˈɑːl ænd lˈɑːl nˈa͡ɪn + lˈɑːl + diff --git a/tests/ssml/billion-laughs.ssml b/tests/ssml/billion-laughs.ssml new file mode 100644 index 00000000..a0b374ea --- /dev/null +++ b/tests/ssml/billion-laughs.ssml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + +]> + + lol &lol9; lol + diff --git a/tests/ssml/external-entity.expected b/tests/ssml/external-entity.expected new file mode 100644 index 00000000..8d8cef37 --- /dev/null +++ b/tests/ssml/external-entity.expected @@ -0,0 +1,9 @@ + + + hˈɪɹ ɑː͡ɹ ðə pˈæswɜːdz + + + ænd ˈɛkszˈiːɾæk + + + diff --git a/tests/ssml/external-entity.ssml b/tests/ssml/external-entity.ssml new file mode 100644 index 00000000..8ceb6058 --- /dev/null +++ b/tests/ssml/external-entity.ssml @@ -0,0 +1,12 @@ + + + +]> + + Here are the passwords: + &xxeattack; + diff --git a/tests/ssml/language-switch.expected b/tests/ssml/language-switch.expected new file mode 100644 index 00000000..5b65ee9b --- /dev/null +++ b/tests/ssml/language-switch.expected @@ -0,0 +1,10 @@ + + bˈuːhuː + + bˈoːhuː + + booˈɔo + + bˌooˈoo + + diff --git a/tests/ssml/language-switch.ssml b/tests/ssml/language-switch.ssml new file mode 100644 index 00000000..8772babb --- /dev/null +++ b/tests/ssml/language-switch.ssml @@ -0,0 +1,7 @@ + + + Boohoo + Boohoo + Boohoo + Boohoo + diff --git a/tests/ssml/spec-example-1.expected b/tests/ssml/spec-example-1.expected new file mode 100644 index 00000000..6760149b --- /dev/null +++ b/tests/ssml/spec-example-1.expected @@ -0,0 +1,12 @@ + + + + juː hæv fˈoː͡ɹ nˈuː mˈɛsɪd͡ʒᵻz + + ðə fˈɜːst ɪz fɹʌm stˈɛfəni wˈɪljəmz ænd ɚɹˈa͡ɪvd æt + θɹˈiː fˈoː͡ɹɾi fˈa͡ɪv pˌiːˈɛm + + ðə sˈʌbd͡ʒɛkt ɪz skˈiː tɹˈɪp + + + diff --git a/tests/ssml/spec-example-1.ssml b/tests/ssml/spec-example-1.ssml new file mode 100644 index 00000000..e46706d5 --- /dev/null +++ b/tests/ssml/spec-example-1.ssml @@ -0,0 +1,18 @@ + + + + + You have 4 new messages. + The first is from Stephanie Williams and arrived at 3:45pm. + + The subject is ski trip + + +
Here are the passwords:
&xxeattack;
Boohoo
+ You have 4 new messages. + The first is from Stephanie Williams and arrived at 3:45pm. + + The subject is ski trip + +