From 96c99e55f4578af8788f1c72a187f3e6875a4cd3 Mon Sep 17 00:00:00 2001 From: Takao Fujiwara Date: Fri, 16 Aug 2024 20:23:11 +0900 Subject: [PATCH] Implement CI with TMT - Add dic-tool-* test files to devel package --- .fmf/version | 1 + anthy-unicode.spec | 9 ++++++++- plans/dict-test.fmf | 5 +++++ tests/migration/main.fmf | 15 +++++++++++++++ tests/migration/test.sh | 16 ++++++++++++++++ 5 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 .fmf/version create mode 100644 plans/dict-test.fmf create mode 100644 tests/migration/main.fmf create mode 100755 tests/migration/test.sh diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/anthy-unicode.spec b/anthy-unicode.spec index 842170f..0bfba64 100644 --- a/anthy-unicode.spec +++ b/anthy-unicode.spec @@ -107,6 +107,11 @@ make install DESTDIR=$RPM_BUILD_ROOT INSTALL="install -p" # remove unnecessary files rm $RPM_BUILD_ROOT%{_libdir}/lib*.la +pushd ./src-util +install -m 644 dic-tool-input $RPM_BUILD_ROOT%{_datadir}/%{pkg} +install -m 644 dic-tool-result $RPM_BUILD_ROOT%{_datadir}/%{pkg} +popd + %if %{with emacs} ## for emacs-anthy mkdir -p $RPM_BUILD_ROOT%{_emacs_sitestartdir} @@ -118,7 +123,7 @@ install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_emacs_sitestartdir} mkdir -p $RPM_BUILD_ROOT%{_xemacs_sitestartdir} install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_xemacs_sitestartdir} # FIXME lisp build -pushd $RPM_BUILD_DIR/%{name}-%{version}/src-util +pushd ./src-util make clean #make EMACS=xemacs lispdir="%%{_xemacs_sitelispdir}/%%{pkg}" # The latest /usr/share/automake-*/am/lisp.am calls -L option for @@ -182,6 +187,8 @@ cd .. %files devel %doc doc/DICLIB doc/DICUTIL doc/GLOSSARY doc/GRAMMAR doc/GUIDE.english doc/ILIB doc/LEARNING doc/LIB doc/MISC doc/POS doc/SPLITTER doc/TESTING doc/protocol.txt +%{_datadir}/%{pkg}/dic-tool-input +%{_datadir}/%{pkg}/dic-tool-result %{_includedir}/* %{_libdir}/lib*.so %{_libdir}/pkgconfig/*.pc diff --git a/plans/dict-test.fmf b/plans/dict-test.fmf new file mode 100644 index 0000000..9c5ae63 --- /dev/null +++ b/plans/dict-test.fmf @@ -0,0 +1,5 @@ +summary: anthy-unicode test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/migration/main.fmf b/tests/migration/main.fmf new file mode 100644 index 0000000..843d404 --- /dev/null +++ b/tests/migration/main.fmf @@ -0,0 +1,15 @@ +summary: Migration tests of private dicts from anthy to anthy-unicode +test: ./test.sh +framework: beakerlib +require: + - anthy-unicode + - anthy-unicode-devel + - autoconf + - automake + - emacs + - fedpkg + - gcc + - git + - libtool + - make + - rpm-build diff --git a/tests/migration/test.sh b/tests/migration/test.sh new file mode 100755 index 0000000..a1bd50c --- /dev/null +++ b/tests/migration/test.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k +. /usr/share/beakerlib/beakerlib.sh || exit 1 + +[ -d $HOME/.anthy ] || mkdir $HOME/.anthy + +rlJournalStart + rlPhaseStartTest + rlRun -t "anthy-dic-tool-unicode --load /usr/share/anthy-unicode/dic-tool-input" + rlRun -t "diff $HOME/.config/anthy/private_words_default /usr/share/anthy-unicode/dic-tool-result" + rlRun -t "anthy-dic-tool-unicode --dump" + rlRun -t "mv $HOME/.config/anthy/private_words_default $HOME/.anthy" + rlRun -t "anthy-dic-tool-unicode --migrate" + rlRun -t "diff $HOME/.config/anthy/private_words_default /usr/share/anthy-unicode/dic-tool-result" + rlPhaseEnd +rlJournalEnd