diff --git a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc index a9cbaf6982..75b58a7683 100644 --- a/meta-oe/conf/include/ptest-packagelists-meta-oe.inc +++ b/meta-oe/conf/include/ptest-packagelists-meta-oe.inc @@ -23,6 +23,7 @@ PTESTS_FAST_META_OE = "\ function2 \ fwupd \ gcab \ + hunspell \ imagemagick \ jemalloc \ jq \ diff --git a/meta-oe/recipes-support/hunspell/files/run-ptest b/meta-oe/recipes-support/hunspell/files/run-ptest new file mode 100644 index 0000000000..d2671c9d4e --- /dev/null +++ b/meta-oe/recipes-support/hunspell/files/run-ptest @@ -0,0 +1,30 @@ +#!/bin/bash + +cd tests + +# skip utf8 non-BMP(Basic Multilingual Plane) +SKIP_TESTS="utf8_nonbmp" + +tests=$(ls *.dic 2>/dev/null | sed 's/\.dic$//') + +if [ -z "$tests" ]; then + echo "SKIP: No test files found" + exit 0 +fi + +for test in $tests; do + if echo "$SKIP_TESTS" | grep -qw "$test"; then + continue + fi + + if ./test.sh "$test" > /dev/null 2>&1; then + echo "PASS: $test" + else + status=$? + if [ $status -eq 3 ]; then + echo "SKIP: $test" + else + echo "FAIL: $test" + fi + fi +done diff --git a/meta-oe/recipes-support/hunspell/hunspell_1.7.3.bb b/meta-oe/recipes-support/hunspell/hunspell_1.7.3.bb index 94ed985c42..28136ea104 100644 --- a/meta-oe/recipes-support/hunspell/hunspell_1.7.3.bb +++ b/meta-oe/recipes-support/hunspell/hunspell_1.7.3.bb @@ -7,14 +7,33 @@ LIC_FILES_CHKSUM = " \ " SRCREV = "c5f98152a274e25b5107101104bef632b83a0cc9" -SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https;tag=v${PV}" +SRC_URI = "git://github.com/${BPN}/${BPN}.git;branch=master;protocol=https;tag=v${PV} \ + file://run-ptest \ +" - -inherit autotools pkgconfig gettext +inherit autotools pkgconfig gettext ptest # ispellaff2myspell: A program to convert ispell affix tables to myspell format PACKAGES =+ "${PN}-ispell" FILES:${PN}-ispell = "${bindir}/ispellaff2myspell" RDEPENDS:${PN}-ispell = "perl" +do_install_ptest() { + install -d ${D}${PTEST_PATH}/tests + install -m 0755 ${S}/tests/test.sh ${D}${PTEST_PATH}/tests/ + + # Install test data files + for ext in dic aff good wrong sug morph root; do + find ${S}/tests -maxdepth 1 -name "*.$ext" -exec cp {} ${D}${PTEST_PATH}/tests/ \; + done + + # Patch test.sh to use installed binaries + sed -i 's|HUNSPELL="$(dirname $0)"/../src/tools/hunspell|HUNSPELL="${bindir}/hunspell"|' ${D}${PTEST_PATH}/tests/test.sh + sed -i 's|ANALYZE="$(dirname $0)"/../src/tools/analyze|ANALYZE="${bindir}/analyze"|' ${D}${PTEST_PATH}/tests/test.sh + sed -i 's|alias hunspell=.*HUNSPELL.*|alias hunspell="$HUNSPELL"|' ${D}${PTEST_PATH}/tests/test.sh + sed -i 's|alias analyze=.*ANALYZE.*|alias analyze="$ANALYZE"|' ${D}${PTEST_PATH}/tests/test.sh +} + +RDEPENDS:${PN}-ptest += "bash glibc-gconv-iso8859-2" + BBCLASSEXTEND = "native"