From 0b609daf29c81e8078984d07a0545e566055eb0c Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 31 May 2024 13:49:44 +0800 Subject: [PATCH] Rewrite CI tests --- .fmf/version | 1 + plans/basic.fmf | 6 ++++++ tests/main.fmf | 27 +++++++++++++++++++++++++++ tests/make_check.sh | 9 +++++++++ tests/tests.yml | 33 --------------------------------- 5 files changed, 43 insertions(+), 33 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/basic.fmf create mode 100644 tests/main.fmf delete mode 100644 tests/tests.yml 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/plans/basic.fmf b/plans/basic.fmf new file mode 100644 index 0000000..d57536e --- /dev/null +++ b/plans/basic.fmf @@ -0,0 +1,6 @@ +summary: Basic smoke test +discover: + how: fmf + dist-git-source: true +execute: + how: tmt diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..861d03e --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,27 @@ +test: bash ./make_check.sh .. +duration: 50m +framework: shell +require: + - make + - libappstream-glib + - desktop-file-utils + - python3-gobject + - python3-gobject-base + - glib2 + - gtk3 + - dconf + - dbus-x11 + - ibus + - ibus-devel + - gcc-c++ + - gettext-devel + - gcc + - intltool + - libtool + - pkgconfig + - sqlite-devel + - libuuid-devel + - lua-devel + - python3-devel + - libpinyin-devel + - rpm-build diff --git a/tests/make_check.sh b/tests/make_check.sh index 7e5a313..3664488 100644 --- a/tests/make_check.sh +++ b/tests/make_check.sh @@ -9,6 +9,15 @@ check_return_value () { } cd $1 + +VERSION=`rpmspec -q --srpm --qf "%{version}" ibus-libpinyin.spec 2>/dev/null` + +if test -d ibus-libpinyin-$VERSION-build; +then cd ibus-libpinyin-$VERSION-build; +fi + +cd ibus-libpinyin-$VERSION + ./configure --prefix=/usr check_return_value $? make check diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 49eab3b..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,33 +0,0 @@ - - hosts: localhost - tags: - - classic - roles: - - role: standard-test-source # to get the source tar ball to do “make check” - - role: standard-test-basic - required_packages: - - make - - libappstream-glib - - desktop-file-utils - - python3-gobject - - python3-gobject-base - - glib2 - - gtk3 - - dconf - - dbus-x11 - - ibus - - ibus-devel - - gcc-c++ - - gettext-devel - - gcc - - intltool - - libtool - - pkgconfig - - sqlite-devel - - libuuid-devel - - lua-devel - - python3-devel - - libpinyin-devel - tests: - - make-check: - dir: . - run: bash ./make_check.sh ./source