[ovs-dev] [PATCH] rhel, xenserver: Run unit tests while creating rpms.

Gurucharan Shetty shettyg at nicira.com
Tue Jul 1 01:40:16 UTC 2014


>
> The correct place to put it is in %check section of the spec file.
> It's not common to see specs using %check section, but it could be
> because most of the projects don't have a testsuite.
>
> Anyway, this is the package guide lines for Fedora:
> http://fedoraproject.org/wiki/Packaging:Guidelines#Writing_a_package_from_scratch
> Look for: "Test Suites" or at rpmbuild man-page look for "--nocheck"
>
> The %check section was introduced in rpm 4.2 (2003) so I believe it is old
> enough to support old distros, but the "--nocheck" option was introduced
> in Aug/2012.
>
> binutils does what I had suggested in %build section.
> # Do not use %%check as it is run after %%install where libbfd.so is
> # rebuild with -fvisibility=hidden no longer being usable in its shared form.
> ...
>     # rpmbuild parameters:
>     # --define "binutils_target arm-linux-gnu" to create arm-linux-gnu-binutils.
>     # --with debug: Build without optimizations and without splitting the debuginfo.
>     # --without testsuite: Do not run the testsuite.  Default is to run it.
>     # --with testsuite: Run the testsuite.  Default --with debug is not to run it.
> ...
>
> The autoconf does better. It mixes %check and the --without parameter
> to work around the fact that "--nocheck" is too recent yet:
> ...
> # run "make check" by default
> %bcond_without check
> ...
> %check
> %if %{with check}
> make check # TESTSUITEFLAGS='1-198 200-' # will disable nr. 199.
> %endif
>
> The %with/%without/%bcond_* macros dates back to 2004, so it's seems
> better to go with autoconf solution. (Enabled by default, using
> bconf_without macro and the condition in %check section).
>
>
Thank you for spending time on this. I incorporated your suggestion
(assuming I understood it correctly) and sent a v2.


More information about the dev mailing list