Allow several pipe delimited hash values for Klatt tests

This commit is contained in:
Valdis Vitolins
2021-07-30 23:05:33 +03:00
parent 9e3528e6a9
commit 9425be8386
2 changed files with 23 additions and 5 deletions
+17
View File
@@ -84,6 +84,23 @@ test_wav () {
fi
}
# Check generated wav file from processed text, where $EXPECTED is grep string
test_wav_grep () {
VOICE=$1
EXPECTED=$2
TEST_TEXT=$3
MESSAGE=$4
echo "testing ${VOICE}${MESSAGE}"
ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \
src/espeak-ng --stdout -v ${VOICE} "${TEST_TEXT}" | \
$sha1sum | awk '{ print $1 }' > actual.txt
if [ "$MESSAGE" = "Ignore" ] ; then
cat actual.txt | grep -E "$EXPECTED" || (echo "... ignoring error" && true)
else
cat actual.txt | grep -E "$EXPECTED" || { printf "wrong hash: "; cat actual.txt; exit 1; }
fi
}
# Check generated wav file from list of phonemes
test_phwav() {
TEST_LANG=$1