#!/bin/sh # include common script . "`dirname $0`/common" # and run needed checks before is_hash test_ssml_audio() { TEST_NAME=$1 EXPECTED=$2 TEST_TEXT=$3 OPTS=$4 echo "testing ${TEST_NAME}" RESULT=$( ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \ $VALGRIND src/espeak-ng --stdout -m "${TEST_TEXT}" ${OPTS} | $sha1sum | awk '{ print $1 }' || exit 1 ) if [ "x$RESULT" != "x$EXPECTED" ] ; then echo "$RESULT != $EXPECTED" exit 1 fi } test_ssml() { INPUT=$1 if [ "$2" = "punct" ] then PARAMETERS="--punct -x" else PARAMETERS="-v en-US --ipa=2" fi echo "testing ${INPUT}" EXPECTED=$(cat $(dirname $INPUT)/$(basename ${INPUT%.*}).expected) RESULT=$( ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} \ $VALGRIND src/espeak-ng -m -q $PARAMETERS -f ${INPUT} || exit 1 ) if [ "x$RESULT" != "x$EXPECTED" ] ; then echo "$RESULT != $EXPECTED" exit 1 fi } for i in `dirname $0`/ssml/*.ssml ; do test_ssml $i; done for i in `dirname $0`/ssml/*.ssml2 ; do test_ssml $i punct; done test_ssml_audio "" 88fccb35536158f25f4ae44a03fb005fef95c99b " Slow and low Fast and high." # #410 is a bug in SSML. Sentence termination causes prosody stack to misfunction. # Hash 8d3bace is the buggy version and should fail: test_ssml_audio " bug #410" 8d3bace9548ae73c4770a73c88c6f65e848b45cf " Slow and low. Fast and high." test_ssml_audio "