From a6453f3751f2848b0168f4c8613c8776c36d12ec Mon Sep 17 00:00:00 2001 From: Yury Popov Date: Wed, 30 Nov 2022 15:24:24 +0300 Subject: [PATCH] tests: fix and re-enable shell tests --- tests/CMakeLists.txt | 6 +++--- tests/bom.test | 4 ++-- tests/language-phonemes.test | 2 +- tests/non-executable-files-with-executable-bit.test | 3 ++- tests/ssml.test | 4 ++-- 5 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc398e51..b8371617 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -43,14 +43,14 @@ compiled_test(readclause) if (SHELL AND UNIX) -# shell_test(bom) -# shell_test(non-executable-files-with-executable-bit) +shell_test(bom) +shell_test(non-executable-files-with-executable-bit) shell_test(cmd_options) shell_test(dictionary) shell_test(language-numbers-cardinal) shell_test(language-numbers-ordinal) -# shell_test(language-phonemes) +shell_test(language-phonemes) shell_test(language-pronunciation) shell_test(language-replace) shell_test(ssml) diff --git a/tests/bom.test b/tests/bom.test index 0e015fd9..b72fbaaf 100755 --- a/tests/bom.test +++ b/tests/bom.test @@ -8,7 +8,8 @@ echo -n "testing for Byte Order Marks in source files ... " # TODO checking for other encodings (e.g. UTF-16, UTF-32, UTF-7) needs more elaborate search, # otherwise it shows many false positives -grep -ErlI $'\xEF\xBB\xBF' * | tee tests/bom.check >/dev/null # UTF-8 +cd $(dirname $0)/.. +grep -ErlI $'\xEF\xBB\xBF' * | grep -v '^build/' | tee tests/bom.check >/dev/null # UTF-8 if [ -s tests/bom.check ] ; then echo "found:" @@ -19,4 +20,3 @@ else echo "none found" true fi - diff --git a/tests/language-phonemes.test b/tests/language-phonemes.test index e29001f6..1f823944 100755 --- a/tests/language-phonemes.test +++ b/tests/language-phonemes.test @@ -8,7 +8,7 @@ is_hash # read column 5 (File) of espeak-ng --voices, skip the directory echo "checking if all supported languages have phoneme tests ..." for lang in $(ESPEAK_DATA_PATH=`pwd` LD_LIBRARY_PATH=src:${LD_LIBRARY_PATH} src/espeak-ng --voices | awk '{print $5}' | cut -d "/" -f 2-2 | tail -n+2); -do if ! grep -q "test_phwav $lang" tests/language-phonemes.test +do if ! grep -q "test_phwav $lang" $0 then echo "$lang missing a phoneme test in tests/language-phonemes.test"; exit 1; diff --git a/tests/non-executable-files-with-executable-bit.test b/tests/non-executable-files-with-executable-bit.test index d88cab00..98b2c7a2 100755 --- a/tests/non-executable-files-with-executable-bit.test +++ b/tests/non-executable-files-with-executable-bit.test @@ -2,8 +2,10 @@ echo -n "testing files for executable bits that shouldn't be executable ... " +cd $(dirname $0)/.. find * -executable -type f | \ grep -vE "compile|config\.(guess|status|sub)|configure|depcomp|install-sh|libtool|missing" | # Ignore autotools output \ + grep -vE "build" | # Ignore cmake output \ grep -vE ".*\.test|tests/common|src(/\.libs)?/(e?speak-ng|.*\.so\..*)|src/\.libs/lt-espeak-ng|android" | # Ignore built programs and libraries \ grep -vE ".*\.sh|tools/emoji" | # Ignore helper scripts \ grep -vE "src/ucd-tools/tools/(.*\.py|mkencodingtable)" | # Ignore ucd-tools helper scripts \ @@ -21,4 +23,3 @@ else echo "none found" true fi - diff --git a/tests/ssml.test b/tests/ssml.test index 36a0a764..6b60040e 100755 --- a/tests/ssml.test +++ b/tests/ssml.test @@ -36,8 +36,8 @@ test_ssml() { diff expected.txt actual.txt || exit 1 } -for i in `ls tests/ssml/*.ssml` ; do test_ssml $i; done -for i in `ls tests/ssml/*.ssml2` ; do test_ssml $i punct; done +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.