#1 Tests
Merged 2 years ago by ppisar. Opened 2 years ago by ppisar.
rpms/ ppisar/perl-Alien-Build rawhide  into  rawhide

file added
+1
@@ -0,0 +1,1 @@ 

+ 1

file modified
+1
@@ -60,3 +60,4 @@ 

  /Alien-Build-2.33.tar.gz

  /Alien-Build-2.37.tar.gz

  /Alien-Build-2.38.tar.gz

+ /Alien-Build-2.40.tar.gz

file added
+7
@@ -0,0 +1,7 @@ 

+ --- !Policy

+ product_versions:

+   - fedora-*

+ decision_context: bodhi_update_push_stable

+ subject_type: koji_build

+ rules:

+   - !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}

@@ -0,0 +1,5 @@ 

+ from Config import *

+ addFilter("-tests\.noarch: W: no-documentation")

+ addFilter("-tests\.noarch: W: devel-file-in-non-devel-package")

+ addFilter("-tests\.noarch: W: hidden-file-or-dir /usr/libexec/")

+ addFilter("-tests\.noarch: E: zero-length /usr/libexec/")

file modified
+105 -11
@@ -7,8 +7,8 @@ 

  %endif

  

  Name:           perl-Alien-Build

- Version:        2.38

- Release:        3%{?dist}

+ Version:        2.40

+ Release:        1%{?dist}

  Summary:        Build external dependencies for use in CPAN

  # lib/Alien/Build/Plugin/Test/Mock.pm contains Base64-encoded files for tests

  # (a bash script, C source file, a gzipped tar archive, Mach-O 64-bit x86_64
@@ -93,15 +93,16 @@ 

  BuildRequires:  perl(File::Glob)

  # Getopt::Long not used

  # IO::Socket::INET not used

+ # HTTP::Server::PSGI not used

  BuildRequires:  perl(lib)

  BuildRequires:  perl(List::Util) >= 1.33

- # Mojo::JSON not used

- # Mojo::URL not used

- # Mojolicious::Lite not used

  BuildRequires:  perl(Net::FTP)

+ # Plack::App::Directory not used

+ # Plack::Builder not used

  # Proc::Daemon not used

  BuildRequires:  perl(Test2::V0) >= 0.000060

  # URI not used

+ # URI::Escape not used

  BuildRequires:  perl(utf8)

  %if %{with perl_Alien_Build_enables_optional_test}

  # Optional tests:
@@ -126,15 +127,15 @@ 

  BuildRequires:  perl(URI::Escape)

  BuildRequires:  perl(URI::file)

  %endif

- # make in the lib/Alien/Build/Plugin/Build/CMake.pm plugin

- # make in the lib/Alien/Build/Plugin/Build/Make.pm plugin

- # make or Alien::gmake

- BuildRequires:  make

  # Alien::Build::Plugin::Build::Copy executes cp

  Requires:       coreutils

  Suggests:       curl

  # Alien::Base::Wrapper::cc() executes $Config{cc}.

  Requires:       gcc

+ # make in the lib/Alien/Build/Plugin/Build/CMake.pm plugin

+ # make in the lib/Alien/Build/Plugin/Build/Make.pm plugin

+ # make or Alien::gmake

+ Requires:       make

  Requires:       perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))

  %if !%{defined perl_bootstrap}

  # Build cycle: perl-Alien-cmake3 → perl-Alien-Build
@@ -183,9 +184,16 @@ 

  %{?perl_default_filter}

  

  # Remove underspecified dependencies

- %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Capture::Tiny|Path::Tiny|Test2::API|Text::ParseWords)\\)$

+ %global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\((Capture::Tiny|Path::Tiny|Test2::API|Test2::V0|Text::ParseWords)\\)$

  # Remove private redefinitions

  %global __provides_exclude %{?__provides_exclude:%{__provides_exclude}|}^perl\\(Alien::Build::rc\\)$

+ # Remove private modules

+ %global __provides_exclude %{__provides_exclude}|^perl\\(MyTest::.*\\)$

+ %global __requires_exclude %{__requires_exclude}|^perl\\(Alien::Build::Plugin::RogerRamjet|Alien::Foo|Alien::libfoo1|Alien::libfoo2|MyTest::.*\\)$

+ 

+ # Some tests, e.g. t/alien_build_plugin_extract_negotiate.t, compare a script file

+ # content against an archived one. Do not rewrite their shebangs.

+ %global __brp_mangle_shebangs_exclude_from %{?__brp_mangle_shebangs_exclude_from:%{__brp_mangle_shebangs_exclude_from}|}^%{_libexecdir}/%{name}/corpus/dist/foo-1\.00/configure$

  

  %description

  This package provides tools for building external (non-CPAN) dependencies
@@ -221,6 +229,38 @@ 

  This Alien::Build plugin decodes an HTML file listing into a list of

  candidates for your Prefer plugin.

  

+ %package tests

+ Summary:        Tests for %{name}

+ Requires:       %{name} = %{?epoch:%{epoch}:}%{version}-%{release}

+ Requires:       coreutils

+ Requires:       perl-Test-Harness

+ Requires:       perl(Net::FTP)

+ Requires:       perl(Test2::V0) >= 0.000060

+ %if %{with perl_Alien_Build_enables_optional_test}

+ %if !%{defined perl_bootstrap}

+ # Break build cycle: Acme::Alien::DontPanic → Test::Alien

+ Requires:       perl(Acme::Alien::DontPanic) >= 0.026

+ # Break build cycle: perl-Alien-Base-ModuleBuild → perl-Alien-Build

+ Requires:       perl(Alien::Base::ModuleBuild) >= 0.040

+ %endif

+ Requires:       perl(Devel::Hide)

+ Requires:       perl(Env::ShellWords)

+ # FFI::Platypus not packaged

+ # HTTP::Tiny or curl

+ Requires:       perl(HTTP::Tiny) >= 0.044

+ # Prefer Mojo::DOM with Mojolicious, URI, URI::Escape over Mojo::DOM58

+ Requires:       perl(Mojo::DOM)

+ Requires:       perl(Mojolicious) >= 7.00

+ # PkgConfig not packaged

+ Requires:       perl(Readonly) >= 1.60

+ Requires:       perl(Sort::Versions)

+ Requires:       perl(URI::file)

+ %endif

+ 

+ %description tests

+ Tests from %{name}. Execute them

+ with "%{_libexecdir}/%{name}/test".

+ 

  %prep

  %setup -q -n Alien-Build-%{version}

  # Remove redundant pkgconfig implementations, keep
@@ -229,6 +269,29 @@ 

  %patch0 -p1

  rm lib/Alien/Build/Plugin/PkgConfig/{CommandLine,PP}.pm 

  rm t/alien_build_plugin_pkgconfig_{commandline,pp}.t

+ # Remove unused tests

+ for F in \

+     t/bin/ftpd \

+     t/bin/httpd \

+ %if !%{with perl_Alien_Build_enables_optional_test} || %{defined perl_bootstrap}

+     t/alien_base__system_installed.t \

+ %endif

+ %if !%{with perl_Alien_Build_enables_optional_test}

+     t/alien_build_plugin_build_searchdep.t \

+     t/alien_build_plugin_extract_commandline__tar_can.t \

+     t/alien_build_plugin_prefer_badversion.t \

+     t/alien_build_plugin_prefer_goodversion.t \

+ %endif

+ ; do

+     rm "$F"

+     perl -i -ne 'print $_ unless m{\A\Q'"$F"'\E\b}' MANIFEST

+     perl -i -ne 'print $_ unless m{\b\Q'"$F"'\E\b}' t/01_use.t

+ done

+ # Help generators to recognize Perl scripts

+ for F in t/*.t; do

+     perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!\s*perl}{$Config{startperl}}' "$F"

+     chmod +x "$F"

+ done

  

  %build

  unset PKG_CONFIG
@@ -237,7 +300,30 @@ 

  

  %install

  %{make_install}

- %{_fixperms} $RPM_BUILD_ROOT/*

+ %{_fixperms} %{buildroot}/*

+ # Install tests

+ mkdir -p %{buildroot}%{_libexecdir}/%{name}

+ cp -a corpus t %{buildroot}%{_libexecdir}/%{name}

+ # t/alienfile.t uses example/*.alienfile

+ mkdir %{buildroot}%{_libexecdir}/%{name}/example

+ cp -a example/*.alienfile %{buildroot}%{_libexecdir}/%{name}/example

+ cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'

+ #!/bin/bash

+ set -e

+ # Many tests, e.g. t/alien_build_commandsequence.t, write into CWD

+ DIR=$(mktemp -d)

+ cp -a %{_libexecdir}/%{name}/* "$DIR"

+ pushd "$DIR"

+ unset ACLOCAL_PATH ALIEN_BASE_WRAPPER_QUIET ALIEN_BUILD_LIVE_TEST \

+     ALIEN_BUILD_LOG ALIEN_BUILD_PKG_CONFIG ALIEN_BUILD_POSTLOAD \

+     ALIEN_BUILD_PRELOAD ALIEN_BUILD_RC ALIEN_BUILD_SITE_CONFIG ALIEN_FORCE \

+     ALIEN_INSTALL_NETWORK ALIEN_INSTALL_TYPE CIPDIST CONFIG_SITE CURL DESTDIR \

+     FOO1 FOO2 FOO3 VERBOSE WGET

+ prove -I . -j "$(getconf _NPROCESSORS_ONLN)"

+ popd

+ rm -r "$DIR"

+ EOF

+ chmod +x %{buildroot}%{_libexecdir}/%{name}/test

  

  %check

  unset ACLOCAL_PATH ALIEN_BASE_WRAPPER_QUIET ALIEN_BUILD_LIVE_TEST \
@@ -245,6 +331,7 @@ 

      ALIEN_BUILD_PRELOAD ALIEN_BUILD_RC ALIEN_BUILD_SITE_CONFIG ALIEN_FORCE \

      ALIEN_INSTALL_NETWORK ALIEN_INSTALL_TYPE CIPDIST CONFIG_SITE CURL DESTDIR \

      FOO1 FOO2 FOO3 VERBOSE WGET

+ export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')

  make test

  

  %files
@@ -267,7 +354,14 @@ 

  %{perl_vendorlib}/Alien/Build/Plugin/Decode/Mojo.pm

  %{_mandir}/man3/Alien::Build::Plugin::Decode::Mojo.3pm.*

  

+ %files tests

+ %{_libexecdir}/%{name}

+ 

  %changelog

+ * Thu May 13 2021 Petr Pisar <ppisar@redhat.com> - 2.40-1

+ - 2.40 bump

+ - Package the tests

+ 

  * Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.38-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild

  

file added
+5
@@ -0,0 +1,5 @@ 

+ summary: Sanity tests

+ discover:

+     how: fmf

+ execute:

+     how: tmt

file modified
+1 -1
@@ -1,1 +1,1 @@ 

- SHA512 (Alien-Build-2.38.tar.gz) = a77b27894c74e9b73fd479f3efb67c748bf9f32931a75471f6e5e0ccbb65d2e5617abfef28f71a7e461f4e1a4216fa8968564aa8ae52ff1bbeae570743fbab81

+ SHA512 (Alien-Build-2.40.tar.gz) = 56854b06d65d690414ed31ebb2c8858d2cc05df12cd854c8328fcaf3c8c1f32f5ad2200898312306bd24c6574c21009c374dc4a9eebf942f05c12631a308eb2f

@@ -0,0 +1,4 @@ 

+ summary: Upstream tests

+ component: perl-Alien-Build

+ require: perl-Alien-Build-tests

+ test: /usr/libexec/perl-Alien-Build/test