Add dedicated tests sub-package
Signed-off-by: Julien Rische <jrische@redhat.com> (cherry picked from commit be6251ccdd390e3a56d84f352cde78aaceff81fb) Co-authored-by: Julien Rische <jrische@redhat.com>
This commit is contained in:
parent
e726fb0f1e
commit
cd3056a588
@ -3,4 +3,4 @@ product_versions:
|
|||||||
- rhel-9
|
- rhel-9
|
||||||
decision_context: osci_compose_gate
|
decision_context: osci_compose_gate
|
||||||
rules:
|
rules:
|
||||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
- !PassingTestCaseRule {test_case_name: osci.brew-build./plans/tests.functional}
|
||||||
|
29
libverto-tests
Executable file
29
libverto-tests
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/sh -eux
|
||||||
|
|
||||||
|
export RPM_PACKAGE_NAME={{ name }}
|
||||||
|
export RPM_PACKAGE_VERSION={{ version }}
|
||||||
|
export RPM_PACKAGE_RELEASE={{ release }}
|
||||||
|
export RPM_ARCH={{ arch }}
|
||||||
|
export RPM_BUILD_NCPUS="$(getconf _NPROCESSORS_ONLN)"
|
||||||
|
|
||||||
|
testdir="$(mktemp -d)"
|
||||||
|
|
||||||
|
# Will remove the temporary test directory when the script terminates
|
||||||
|
# (even if stopped by an exit signal)
|
||||||
|
trap "rm -rf ${testdir}" EXIT
|
||||||
|
|
||||||
|
build_flags="$(eval "echo $(rpm --eval '%{_smp_mflags}')")"
|
||||||
|
|
||||||
|
mkdir "${testdir}/{{ name }}-tests"
|
||||||
|
cp -rp /usr/share/{{ name }}-tests/{{ arch }} "${testdir}/{{ name }}-tests/"
|
||||||
|
|
||||||
|
autoreconf -fiv "${testdir}/{{ name }}-tests/{{ arch }}"
|
||||||
|
|
||||||
|
mkdir -p "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs"
|
||||||
|
ln -s {{ libdir }}/libverto.so "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
||||||
|
ln -s {{ libdir }}/libverto.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
||||||
|
ln -s {{ libdir }}/libverto-glib.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
||||||
|
ln -s {{ libdir }}/libverto-libev.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
||||||
|
ln -s {{ libdir }}/libverto-libevent.so.1.0.0 "${testdir}/{{ name }}-tests/{{ arch }}/src/.libs/"
|
||||||
|
|
||||||
|
make -C "${testdir}/{{ name }}-tests/{{ arch }}/tests/" $build_flags check-TESTS
|
@ -2,23 +2,29 @@
|
|||||||
|
|
||||||
Name: libverto
|
Name: libverto
|
||||||
Version: 0.3.2
|
Version: 0.3.2
|
||||||
Release: 3%{?dist}
|
Release: 4%{?dist}
|
||||||
Summary: Main loop abstraction library
|
Summary: Main loop abstraction library
|
||||||
|
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: %{homepage}
|
URL: %{homepage}
|
||||||
Source0: %{homepage}/releases/download/%{version}/%{name}-%{version}.tar.gz
|
Source0: %{homepage}/releases/download/%{version}/%{name}-%{version}.tar.gz
|
||||||
|
Source1: %{name}-tests
|
||||||
|
|
||||||
BuildRequires: autoconf
|
%global common_dependencies() %{expand:
|
||||||
BuildRequires: automake
|
%1: autoconf
|
||||||
BuildRequires: libtool
|
%1: automake
|
||||||
BuildRequires: make
|
%1: libtool
|
||||||
|
%1: gcc
|
||||||
|
%1: make
|
||||||
|
%1: redhat-rpm-config
|
||||||
|
}
|
||||||
|
|
||||||
BuildRequires: glib2-devel
|
%{common_dependencies BuildRequires}
|
||||||
BuildRequires: libevent-devel
|
|
||||||
BuildRequires: libev-devel
|
|
||||||
|
|
||||||
BuildRequires: git
|
BuildRequires: git
|
||||||
|
BuildRequires: glib2-devel
|
||||||
|
BuildRequires: libevent-devel
|
||||||
|
BuildRequires: libev-devel
|
||||||
|
|
||||||
Obsoletes: libverto-tevent < 0.3.0-2
|
Obsoletes: libverto-tevent < 0.3.0-2
|
||||||
Obsoletes: libverto-tevent-devel < 0.3.0-2
|
Obsoletes: libverto-tevent-devel < 0.3.0-2
|
||||||
@ -103,6 +109,20 @@ developing applications that use %{name}-libev.
|
|||||||
This package provides %{name}-module-base since it supports io, timeout
|
This package provides %{name}-module-base since it supports io, timeout
|
||||||
and signal.
|
and signal.
|
||||||
|
|
||||||
|
%package tests
|
||||||
|
Summary: Test sources for %{name} build
|
||||||
|
|
||||||
|
Requires: %{name}-devel%{?_isa} = %{version}-%{release}
|
||||||
|
Requires: %{name}-glib%{?_isa} = %{version}-%{release}
|
||||||
|
Requires: %{name}-libev%{?_isa} = %{version}-%{release}
|
||||||
|
Requires: %{name}-libevent%{?_isa} = %{version}-%{release}
|
||||||
|
|
||||||
|
%{common_dependencies Requires}
|
||||||
|
|
||||||
|
%description tests
|
||||||
|
FOR TESTING PURPOSE ONLY
|
||||||
|
Test sources for %{name} build, with pre-defined compilation parameters
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%autosetup -S git
|
%autosetup -S git
|
||||||
|
|
||||||
@ -121,6 +141,22 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
|||||||
%ldconfig_scriptlets libevent
|
%ldconfig_scriptlets libevent
|
||||||
%ldconfig_scriptlets libev
|
%ldconfig_scriptlets libev
|
||||||
|
|
||||||
|
# Generate tests launching script
|
||||||
|
sed -e 's|{{ name }}|%{name}|g' \
|
||||||
|
-e 's|{{ version }}|%{version}|g' \
|
||||||
|
-e 's|{{ release }}|%{release}|g' \
|
||||||
|
-e 's|{{ libdir }}|%{_libdir}|g' \
|
||||||
|
-e 's|{{ arch }}|%{_arch}|g' \
|
||||||
|
-i %{SOURCE1}
|
||||||
|
mkdir -p $RPM_BUILD_ROOT%{_libexecdir}
|
||||||
|
install -pm 755 %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/%{name}-tests-%{_arch}
|
||||||
|
|
||||||
|
# Copy files from build folder to system data folder
|
||||||
|
make mostlyclean
|
||||||
|
rm -rf .git .gitignore src/.libs
|
||||||
|
install -pdm 755 $RPM_BUILD_ROOT%{_datarootdir}/%{name}-tests/%{_arch}
|
||||||
|
cp -r * $RPM_BUILD_ROOT%{_datarootdir}/%{name}-tests/%{_arch}/
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%{!?_licensedir:%global license %%doc}
|
%{!?_licensedir:%global license %%doc}
|
||||||
%license COPYING
|
%license COPYING
|
||||||
@ -157,7 +193,14 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';'
|
|||||||
%{_libdir}/%{name}-libev.so
|
%{_libdir}/%{name}-libev.so
|
||||||
%{_libdir}/pkgconfig/%{name}-libev.pc
|
%{_libdir}/pkgconfig/%{name}-libev.pc
|
||||||
|
|
||||||
|
%files tests
|
||||||
|
%{_libexecdir}/%{name}-tests-%{_arch}
|
||||||
|
%{_datarootdir}/%{name}-tests/%{_arch}
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Fri Mar 21 2025 Julien Rische <jrische@redhat.com> - 0.3.2-4
|
||||||
|
- Add dedicated tests sub-package
|
||||||
|
|
||||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.2-3
|
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 0.3.2-3
|
||||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||||
Related: rhbz#1991688
|
Related: rhbz#1991688
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
summary: Tests
|
||||||
discover:
|
discover:
|
||||||
how: fmf
|
how: fmf
|
||||||
execute:
|
execute:
|
@ -3,16 +3,7 @@ contact: Anuja More <amore@redhat.com>
|
|||||||
component:
|
component:
|
||||||
- libverto
|
- libverto
|
||||||
require:
|
require:
|
||||||
- libverto
|
- libverto-tests
|
||||||
- libverto-devel
|
|
||||||
- libverto-glib-devel
|
|
||||||
- libverto-libevent-devel
|
|
||||||
- make
|
|
||||||
- rpm-build
|
|
||||||
- fmf
|
|
||||||
- wget
|
|
||||||
- autoconf
|
|
||||||
- autoconf-archive
|
|
||||||
test: ./runtest.sh
|
test: ./runtest.sh
|
||||||
duration: 25m
|
duration: 25m
|
||||||
enabled: true
|
enabled: true
|
||||||
|
@ -1,29 +1,7 @@
|
|||||||
#!/bin/sh -ex
|
#!/bin/sh -eux
|
||||||
|
rc=0
|
||||||
dnf -y --nogpgcheck build-dep ../../libverto.spec
|
for test_exec in /usr/libexec/libverto-tests-*
|
||||||
|
do
|
||||||
wget https://github.com/latchset/libverto/releases/download/0.3.2/libverto-0.3.2.tar.gz
|
"$test_exec" || rc=1
|
||||||
tar -xvzf libverto-0.3.2.tar.gz
|
|
||||||
cd libverto-0.3.2
|
|
||||||
|
|
||||||
# Generate Makefiles, directory layout, ...
|
|
||||||
autoreconf -fiv
|
|
||||||
./configure --with-glib --with-libevent --disable-dependency-tracking
|
|
||||||
make -sj
|
|
||||||
|
|
||||||
# Avoid running `make check` here
|
|
||||||
cd tests
|
|
||||||
ls *.c | while read f; do
|
|
||||||
f="$(echo $f | awk -F. '{print $1}')"
|
|
||||||
make $f
|
|
||||||
done
|
done
|
||||||
cd ..
|
exit $rc
|
||||||
|
|
||||||
# Overwrite the build.
|
|
||||||
cd src/.libs
|
|
||||||
cp /usr/lib64/libverto-glib.so.1.0.0 .
|
|
||||||
cp /usr/lib64/libverto-libevent.so.1.0.0 .
|
|
||||||
cd ../..
|
|
||||||
|
|
||||||
# Go time.
|
|
||||||
exec make check
|
|
||||||
|
Loading…
Reference in New Issue
Block a user