Add tmt testcase for CI
This commit is contained in:
parent
ce0edf2582
commit
ea2124fea2
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
||||
5
plans/graphite2.fmf
Normal file
5
plans/graphite2.fmf
Normal file
@ -0,0 +1,5 @@
|
||||
summary: Basic smoke test
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
||||
12
tests/main.fmf
Normal file
12
tests/main.fmf
Normal file
@ -0,0 +1,12 @@
|
||||
test: ./runtests.sh
|
||||
duration: 10m
|
||||
framework: beakerlib
|
||||
require:
|
||||
- graphite2
|
||||
- cmake
|
||||
- make
|
||||
- python3-fonttools
|
||||
- rpm-build
|
||||
- gcc
|
||||
- gcc-c++
|
||||
- freetype-devel
|
||||
40
tests/runtests.sh
Executable file
40
tests/runtests.sh
Executable file
@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
. /usr/share/beakerlib/beakerlib.sh || exit 1
|
||||
|
||||
NAME=graphite2
|
||||
|
||||
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 "cmake -DCMAKE_BUILD_TYPE=Release -S . -B build"
|
||||
rlRun "cmake --build build"
|
||||
rlRun "pushd build"
|
||||
rlRun "ctest"
|
||||
rlRun "retval=$?"
|
||||
rlRun "echo $retval"
|
||||
rlRun "popd"
|
||||
rlPhaseEnd
|
||||
|
||||
rlPhaseStartCleanup
|
||||
rlRun "popd"
|
||||
rlRun "rm -r $tmp" 0 "Remove tmp directory"
|
||||
rlPhaseEnd
|
||||
rlJournalEnd
|
||||
|
||||
Loading…
Reference in New Issue
Block a user