From ec18e42809b1a47f1cc2951990d20e677e5f6431 Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Wed, 22 Jun 2016 13:21:54 +0200 Subject: [PATCH] check: add basic testsuite Version: 1-5 --- multilib-rpm-config.spec | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/multilib-rpm-config.spec b/multilib-rpm-config.spec index 85165e0..7e1a0c3 100644 --- a/multilib-rpm-config.spec +++ b/multilib-rpm-config.spec @@ -15,6 +15,8 @@ Release: 5%{?dist} License: GPLv2+ URL: https://fedoraproject.org/wiki/PackagingDrafts/MultilibTricks +BuildRequires: gcc + Source0: multilib-fix Source1: macros.ml Source2: README @@ -63,6 +65,51 @@ install -m 755 -p multilib-fix %{buildroot}/%{ml_fix} install -m 755 -p multilib-info %{buildroot}/%{ml_info} +%check +mkdir tests ; cd tests +ml_fix="sh `pwd`/../multilib-fix --buildroot `pwd`" +capable="sh `pwd`/../multilib-info --multilib-capable" + +mkdir template +cat > template/main.c < template/header.h < +void call (void) { printf ("works!\n"); } +EOF + +cp -r template basic +gcc ./basic/main.c +./a.out + +pwd +if $capable; then + cp -r template really-works + $ml_fix --file /really-works/header.h + gcc really-works/main.c + ./a.out + test -f really-works/header-*.h +fi + +cp -r template other_arch +$ml_fix --file /other_arch/header.h --arch ppc64 +test -f other_arch/header-*.h + +cp -r template other_arch_fix +$ml_fix --file /other_arch_fix/header.h --arch ppc64p7 +test -f other_arch_fix/header-ppc64.h + +cp -r template aarch64-no-change +$ml_fix --file /aarch64-no-change/header.h --arch aarch64 +test ! -f aarch64-no-change/header-*.h + +test `$capable --arch x86_64` = true +test `$capable --arch aarch64` = false +test `$capable --arch ppc64p7` = true + + %files %license COPYING %doc README @@ -73,6 +120,7 @@ install -m 755 -p multilib-info %{buildroot}/%{ml_info} %changelog * Wed Jun 22 2016 Pavel Raiskup - 1-5 - document why there is no need for '#else' in the replacement header +- add basic testsuite * Mon Jun 13 2016 Pavel Raiskup - 1-4 - use '-' as a field separator by default