From a78e3e0bd3fbcd8a9d07fcfb6012183d7aaa0373 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Tue, 28 May 2024 13:32:25 +0800 Subject: [PATCH] Rewrite CI tests --- .fmf/version | 1 + plans/basic.fmf | 6 ++++++ tests/main.fmf | 12 ++++++++++++ tests/make_check.sh | 9 +++++++++ tests/tests.yml | 21 --------------------- 5 files changed, 28 insertions(+), 21 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..1f84a51 --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,12 @@ +test: bash ./make_check.sh .. +duration: 50m +framework: shell +require: + - make + - gcc + - autoconf + - autoconf-archive + - automake + - libtool + - doxygen + - rpm-build diff --git a/tests/make_check.sh b/tests/make_check.sh index 00f8111..cc77d45 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}" libdatrie.spec 2>/dev/null` + +if test -d libdatrie-$VERSION-build; +then cd libdatrie-$VERSION-build; +fi + +cd libdatrie-$VERSION + autoreconf -f -i -v ./configure --prefix=/usr check_return_value $? diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 68a065c..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,21 +0,0 @@ -- hosts: localhost - vars: - - artifacts: "{{ lookup('env', 'TEST_ARTIFACTS')|default('./artifacts', true) }}" - tags: - - classic - remote_user: root - roles: - - role: standard-test-source # to get the source tar ball to do “make check” - - role: standard-test-basic - required_packages: - - make - - gcc - - autoconf - - autoconf-archive - - automake - - libtool - - doxygen - tests: - - make-check: - dir: ./ - run: bash ./make_check.sh ./source