Add tmt testcase for CI
This commit is contained in:
parent
67014999ec
commit
3b169b06b9
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
5
plans/hspell.fmf
Normal file
5
plans/hspell.fmf
Normal file
@ -0,0 +1,5 @@
|
||||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
11
tests/main.fmf
Normal file
11
tests/main.fmf
Normal file
@ -0,0 +1,11 @@
|
||||
test: ./runtests.sh
|
||||
duration: 10m
|
||||
framework: beakerlib
|
||||
require:
|
||||
- hspell
|
||||
- hunspell-he
|
||||
- make
|
||||
- gcc
|
||||
- gzip
|
||||
- zlib-devel
|
||||
- rpm-build
|
41
tests/runtests.sh
Executable file
41
tests/runtests.sh
Executable file
@ -0,0 +1,41 @@
|
||||
#!/bin/bash
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
NAME=convmv
|
||||
|
||||
rlJournalStart
|
||||
rlPhaseStartSetup
|
||||
rlAssertRpm ${NAME}
|
||||
rlShowPackageVersion ${NAME}
|
||||
rlRun -t -l "VERSION=$(rpm -q ${NAME} --queryformat='%{version}')" 0 "Get VERSION"
|
||||
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
|
||||
rlRun "pushd $tmp"
|
||||
rlFetchSrcForInstalled "${NAME}"
|
||||
rlRun "rpm --define '_topdir $tmp' -i *src.rpm"
|
||||
rlRun -t -l "mkdir BUILD" 0 "Creating BUILD directory"
|
||||
rlRun -t -l "rpmbuild --noclean --nodeps --define '_topdir $tmp' -bp $tmp/SPECS/*spec"
|
||||
if [ -d BUILD/${NAME}-${VERSION}-build ]; then
|
||||
rlRun -t -l "pushd BUILD/${NAME}-${VERSION}-build/${NAME}-${VERSION}"
|
||||
else
|
||||
rlRun -t -l "pushd BUILD/${NAME}-${VERSION}"
|
||||
fi
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartTest
|
||||
rlRun "set -o pipefail"
|
||||
rlRun "echo "Default installation does not have aspell binary so remove its execution""
|
||||
rlRun "sed -i 's/he.rws hunspell/hunspell/g' Makefile.in"
|
||||
rlRun "./configure"
|
||||
rlRun "sed -i '82,84d' test/test1"
|
||||
rlRun "make V=1 test"
|
||||
rlRun "retval=$?"
|
||||
rlRun "echo $retval"
|
||||
rlRun "popd" 0
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
@ -1,7 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd ../source
|
||||
echo "Default installation does not have aspell binary so remove its execution"
|
||||
sed -i 's/he.rws hunspell/hunspell/g' Makefile.in
|
||||
./configure
|
||||
sed -i '82,84d' test/test1
|
||||
make V=1 test
|
6
tests/test_dic_availability.fmf
Normal file
6
tests/test_dic_availability.fmf
Normal file
@ -0,0 +1,6 @@
|
||||
require:
|
||||
- python3-enchant
|
||||
- hunspell-he
|
||||
test: python3 test_dic_availability.py
|
||||
framework: shell
|
||||
|
10
tests/test_dic_availability.py
Normal file
10
tests/test_dic_availability.py
Normal file
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import enchant
|
||||
|
||||
lang = "he_IL"
|
||||
try:
|
||||
dic = enchant.request_dict(lang)
|
||||
print("Dictionary for {0} language is available for use".format(lang))
|
||||
except enchant.errors.DictNotFoundError:
|
||||
print("Dictionary is not installed for use")
|
6
tests/test_suggest_words.fmf
Normal file
6
tests/test_suggest_words.fmf
Normal file
@ -0,0 +1,6 @@
|
||||
require:
|
||||
- python3-enchant
|
||||
- hunspell-he
|
||||
test: python3 test_suggest_words.py
|
||||
framework: shell
|
||||
|
9
tests/test_suggest_words.py
Normal file
9
tests/test_suggest_words.py
Normal file
@ -0,0 +1,9 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import enchant
|
||||
|
||||
wdlst = [ "שלום", "תֵה", "שַׁחַר"]
|
||||
dic = enchant.Dict("he_IL")
|
||||
for wd in wdlst:
|
||||
dic.check(wd)
|
||||
print("input word = {0}, Suggestions => {1}".format(wd, dic.suggest(wd)))
|
@ -1,20 +0,0 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
roles:
|
||||
- role: standard-test-source
|
||||
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tests:
|
||||
- smoke
|
||||
required_packages:
|
||||
- gcc
|
||||
- make
|
||||
- hspell
|
||||
- gzip
|
||||
- zlib-devel
|
Loading…
Reference in New Issue
Block a user