From ff9b399795189132722b9158867077177b05a716 Mon Sep 17 00:00:00 2001 From: Zeming LIU Date: Wed, 27 May 2026 21:47:33 +0800 Subject: [PATCH] hunspell: add ptest support Test results: root@qemux86-64:~# ptest-runner hunspell START: ptest-runner 2026-05-27T07:06 BEGIN: /usr/lib/hunspell/ptest PASS: 1463589 PASS: 1463589_utf PASS: 1592880 PASS: 1695964 PASS: 1706659 PASS: 1748408-1 PASS: 1748408-2 PASS: 1748408-3 PASS: 1748408-4 PASS: 1975530 PASS: 2970240 PASS: 2970242 PASS: 2999225 PASS: IJ PASS: affixes PASS: alias PASS: alias2 PASS: alias3 PASS: allcaps PASS: allcaps2 PASS: allcaps3 PASS: allcaps_utf PASS: arabic PASS: base PASS: base_utf PASS: break PASS: breakdefault PASS: breakoff PASS: checkcompoundcase PASS: checkcompoundcase2 PASS: checkcompoundcaseutf PASS: checkcompounddup PASS: checkcompoundpattern PASS: checkcompoundpattern2 PASS: checkcompoundpattern3 PASS: checkcompoundpattern4 PASS: checkcompoundrep PASS: checkcompoundrep2 PASS: checkcompoundtriple PASS: checksharps PASS: checksharpsutf PASS: circumfix PASS: colons_in_words PASS: complexprefixes PASS: complexprefixes2 PASS: complexprefixesutf PASS: compound_wnum_overflow PASS: compoundaffix PASS: compoundaffix2 PASS: compoundaffix3 PASS: compoundflag PASS: compoundforbid PASS: compoundrule PASS: compoundrule2 PASS: compoundrule3 PASS: compoundrule4 PASS: compoundrule5 PASS: compoundrule6 PASS: compoundrule7 PASS: compoundrule8 PASS: condition PASS: condition_utf PASS: conditionalprefix PASS: digits_in_words PASS: dotless_i PASS: encoding PASS: flag PASS: flaglong PASS: flagnum PASS: flagutf8 PASS: fogemorpheme PASS: forbiddenword PASS: forceucase PASS: fullstrip PASS: germancompounding PASS: germancompoundingold PASS: gh-hunzip-overflow PASS: gh1002 PASS: gh1018 PASS: gh1032 PASS: gh1044 PASS: gh1058 PASS: gh1076 PASS: gh1086 PASS: gh1095 PASS: gh646 PASS: hu PASS: i35725 PASS: i53643 PASS: i54633 PASS: i54980 PASS: i58202 PASS: i68568 PASS: i68568utf PASS: iconv PASS: iconv2 PASS: iconv_break_overflow PASS: ignore PASS: ignoresug PASS: ignoreutf PASS: keepcase PASS: korean PASS: limit-multiple-compounding PASS: map PASS: maputf PASS: morph PASS: needaffix PASS: needaffix2 PASS: needaffix3 PASS: needaffix4 PASS: needaffix5 PASS: nepali PASS: ngram_utf_fix PASS: nosuggest PASS: oconv PASS: oconv2 PASS: ofz51432 PASS: ofz5627151457255424 PASS: onlyincompound PASS: onlyincompound2 PASS: opentaal_cpdpat PASS: opentaal_cpdpat2 PASS: opentaal_forbiddenword1 PASS: opentaal_forbiddenword2 PASS: opentaal_keepcase PASS: ph PASS: ph2 PASS: phone PASS: rep PASS: reputf PASS: right_to_left_mark PASS: simplifiedtriple PASS: slash PASS: sug PASS: sug2 PASS: sugutf PASS: timelimit PASS: utf8 PASS: utf8_bom PASS: utf8_bom2 PASS: utfcompound PASS: warn PASS: wordpair PASS: zeroaffix DURATION: 5 END: /usr/lib/hunspell/ptest 2026-05-27T07:06 STOP: ptest-runner Signed-off-by: Zeming LIU Signed-off-by: Khem Raj --- .../include/ptest-packagelists-meta-oe.inc | 1 + .../recipes-support/hunspell/files/run-ptest | 30 +++++++++++++++++++ .../hunspell/hunspell_1.7.3.bb | 25 ++++++++++++++-- 3 files changed, 53 insertions(+), 3 deletions(-) create mode 100644 meta-oe/recipes-support/hunspell/files/run-ptest 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"