Add tests and gating.yaml

This commit is contained in:
Jitka Plesnikova 2024-07-23 14:39:15 +02:00
parent af94621919
commit 2816faeee1
6 changed files with 97 additions and 2 deletions

1
.fmf/version Normal file
View File

@ -0,0 +1 @@
1

View File

@ -0,0 +1,38 @@
diff -up Devel-StackTrace-2.05/t/01-basic.t.orig Devel-StackTrace-2.05/t/01-basic.t
--- Devel-StackTrace-2.05/t/01-basic.t.orig 2024-07-23 14:28:23.297737233 +0200
+++ Devel-StackTrace-2.05/t/01-basic.t 2024-07-23 14:31:14.792422763 +0200
@@ -58,7 +58,7 @@ my $test_file_name = get_file_name();
Trace begun at $test_file_name line 1009
main::baz(1, 2) called at $test_file_name line 1005
main::bar(1) called at $test_file_name line 1001
-main::foo at $test_file_name line 13
+main::foo at $test_file_name line 14
EOF
is( $trace->as_string, $trace_text, 'trace text' );
@@ -100,7 +100,7 @@ EOF
my $trace_text = <<"EOF";
Trace begun at $test_file_name line 1009
-main::baz at $test_file_name line 99
+main::baz at $test_file_name line 100
EOF
my $t = "$trace";
@@ -308,14 +308,14 @@ if ( $Exception::Class::VERSION && $Exce
my $trace_text = <<"EOF";
Trace begun at $test_file_name line 1021
-main::max_arg_length('abcdefghij...') called at $test_file_name line 307
+main::max_arg_length('abcdefghij...') called at $test_file_name line 308
EOF
is( $trace->as_string, $trace_text, 'trace text' );
my $trace_text_1 = <<"EOF";
Trace begun at $test_file_name line 1021
-main::max_arg_length('abc...') called at $test_file_name line 307
+main::max_arg_length('abc...') called at $test_file_name line 308
EOF
is(

7
gating.yaml Normal file
View File

@ -0,0 +1,7 @@
# RHEL
--- !Policy
product_versions:
- rhel-*
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

View File

@ -2,11 +2,12 @@ Name: perl-Devel-StackTrace
Summary: Perl module implementing stack trace and stack trace frame objects
Version: 2.05
Epoch: 1
Release: 4%{?dist}
Release: 5%{?dist}
License: Artistic-2.0
URL: https://metacpan.org/release/Devel-StackTrace
Source0: https://cpan.metacpan.org/authors/id/D/DR/DROLSKY/Devel-StackTrace-%{version}.tar.gz
BuildArch: noarch
Patch0: Devel-StackTrace-2.05-Fix-number-of-line-for-added-shebang.patch
BuildRequires: perl-generators
BuildRequires: %{__perl}
@ -14,6 +15,7 @@ BuildRequires: %{__make}
BuildRequires: perl(base)
BuildRequires: perl(bytes)
BuildRequires: perl(Config)
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(File::Spec)
BuildRequires: perl(overload)
@ -32,8 +34,23 @@ The Devel::StackTrace object contains a set of Devel::StackTraceFrame
objects, one for each level of the stack. The frames contain all the
data available from caller() as of Perl 5.6.0.
%package tests
Summary: Tests for %{name}
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: perl-Test-Harness
%description tests
Tests from %{name}. Execute them
with "%{_libexecdir}/%{name}/test".
%prep
%setup -q -n Devel-StackTrace-%{version}
%patch -P0 -p1
# Help generators to recognize Perl scripts
for F in t/*.t; do
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
chmod +x "$F"
done
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
@ -41,7 +58,16 @@ data available from caller() as of Perl 5.6.0.
%install
%{make_install}
%{_fixperms} $RPM_BUILD_ROOT/*
%{_fixperms} %{buildroot}/*
# Install tests
mkdir -p %{buildroot}%{_libexecdir}/%{name}
cp -a t %{buildroot}%{_libexecdir}/%{name}
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
#!/bin/sh
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
EOF
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
%check
%{__make} test
@ -52,7 +78,13 @@ data available from caller() as of Perl 5.6.0.
%{perl_vendorlib}/Devel
%{_mandir}/man3/*
%files tests
%{_libexecdir}/%{name}
%changelog
* Tue Jul 23 2024 Jitka Plesnikova <jplesnik@redhat.com> - 1:2.05-5
- Package tests
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1:2.05-4
- Bump release for June 2024 mass rebuild

5
plans/sanity.fmf Normal file
View File

@ -0,0 +1,5 @@
summary: Sanity tests
discover:
how: fmf
execute:
how: tmt

12
tests/upstream-tests.fmf Normal file
View File

@ -0,0 +1,12 @@
summary: Upstream tests
contact: Jitka Plesnikova <jplesnik@redhat.com>
component: perl-Devel-StackTrace
require: perl-Devel-StackTrace-tests
test: /usr/libexec/perl-Devel-StackTrace/test
enabled: true
tag:
- rhel-buildroot
adjust:
- enabled: false
when: distro < rhel-10 or distro < centos-stream-10
continue: false