Add test case for 32 bit library support

Add test case (c-helloworld-32) to test 32-bit library support and
update other tests for newest configuration option introduced.
This commit is contained in:
Matthew Johnson
2016-12-12 10:43:42 -08:00
parent 2268ab9d1f
commit f0e64eee2c
16 changed files with 153 additions and 0 deletions
+5
View File
@@ -370,6 +370,11 @@ The options that can be set in ``options.conf`` are as follows:
If this option is set, then ``%define keepstatic 1`` is emitted in the ``.spec``.
As a result, any static archive (``.a``) files will not be removed by rpmbuild.
**32bit**
This option will trigger the creation of 32-bit libraries for a 32-bit
build.
Name and version resolution
===========================
+9
View File
@@ -0,0 +1,9 @@
DESTDIR ?=
PREFIX ?= /usr/local
helloworld:
gcc main.c -o helloworld
install: helloworld
install -m 0755 -d $(DESTDIR)$(PREFIX)/bin
install -m 0755 helloworld $(DESTDIR)$(PREFIX)/bin
@@ -0,0 +1,3 @@
# This file contains additional build requirements that did not get
# picked up automatically. One name per line, no whitespace.
xz
@@ -0,0 +1,2 @@
# This file contains build requirements that get picked up but are
# undesirable. One entry per line, no whitespace.
@@ -0,0 +1 @@
GPL-3.0
@@ -0,0 +1,11 @@
[autospec]
32bit = true
allow_test_failures = false
asneeded = false
broken_c++ = false
broken_parallel_build = false
conservative_flags = false
fast-math = false
funroll-loops = false
insecure_build = false
@@ -0,0 +1,2 @@
# This file contains additional pkgconfig build requirements that did
# not get picked up automatically. One name per line, no whitespace.
@@ -0,0 +1,2 @@
# This file contains pkgconfig build requirements that get picked up
# but are undesirable. One entry per line, no whitespace.
@@ -0,0 +1,36 @@
[autospec]
# build 32 bit libraries
32bit = true
# allow package to build with test failures
allow_test_failures = false
# unset %build ld_as_needed variable
asneeded = false
# extend flags with '-std=gnu++98
broken_c++ = false
# disable parallelization during build
broken_parallel_build = false
# set conservative build flags
conservative_flags = false
# pass -ffast-math to compiler
fast-math = false
# optimize build for speed over size
funroll-loops = false
# set flags to smallest -02 flags possible
insecure_build = false
# do not remove static libraries
keepstatic = false
# do not require autostart suepackage
no_autostart = false
# optimize build for size over speed
optimize_size = false
# set profile for pgo
pgo = false
# do not run test suite
skip_tests = false
# configure build for avx2
use_avx2 = false
# add clang flags
use_clang = false
# configure build for lto
use_lto = false
@@ -0,0 +1,23 @@
"""
This file, expectations.py, defines expected test results and is not added to
the test source tarball.
"""
import os
buildreqs = ['xz',
'gcc-dev32',
'gcc-libgcc32',
'gcc-libstdc++32',
'glibc-dev32',
'glibc-libc32']
license = 'GPL-3.0'
with open('tests/testfiles/c-helloworld-32/spec-expectations', 'r') as spec:
specfile = spec.read()
specfile = specfile.replace('{}', os.getcwd()).split('\n')
with open('tests/testfiles/c-helloworld-32/conf-expectations', 'r') as conf:
conffile = conf.read()
conffile = conffile.split('\n')
output_strings = []
+3
View File
@@ -0,0 +1,3 @@
#include<stdio.h>
int main(){printf("Hello World\n");}
@@ -0,0 +1,48 @@
#
# This file is auto-generated. DO NOT EDIT
# Generated by: autospec.py
#
Name : c-helloworld-32
Version : 1
Release : 1
URL : file://{}/tests/testfiles/c-helloworld-32.tar.gz
Source0 : file://{}/tests/testfiles/c-helloworld-32.tar.gz
Summary : No detailed summary available
Group : Development/Tools
License : GPL-3.0
BuildRequires : gcc-dev32
BuildRequires : gcc-libgcc32
BuildRequires : gcc-libstdc++32
BuildRequires : glibc-dev32
BuildRequires : glibc-libc32
BuildRequires : xz
%description
No detailed description available
%prep
%setup -q -n c-helloworld-32
pushd ..
cp -a c-helloworld-32 build32
popd
%build
export LANG=C
make V=1 %{?_smp_mflags}
%install
rm -rf %{buildroot}
pushd ../build32/
%make_install32
if [ -d %{buildroot}/usr/lib32/pkgconfig ]
then
pushd %{buildroot}/usr/lib32/pkgconfig
for i in *.pc ; do mv $i 32$i ; done
popd
fi
popd
%make_install
%files
%defattr(-,root,root,-)
/usr/local/bin/helloworld
@@ -1,4 +1,6 @@
[autospec]
# build 32 bit libraries
32bit = false
# allow package to build with test failures
allow_test_failures = true
# unset %build ld_as_needed variable
@@ -1,4 +1,6 @@
[autospec]
# build 32 bit libraries
32bit = false
# allow package to build with test failures
allow_test_failures = false
# unset %build ld_as_needed variable
@@ -1,4 +1,6 @@
[autospec]
# build 32 bit libraries
32bit = false
# allow package to build with test failures
allow_test_failures = false
# unset %build ld_as_needed variable
@@ -1,4 +1,6 @@
[autospec]
# build 32 bit libraries
32bit = false
# allow package to build with test failures
allow_test_failures = false
# unset %build ld_as_needed variable