Accepting request 640471 from devel:languages:perl:CPAN-T

- Created

OBS-URL: https://build.opensuse.org/request/show/640471
OBS-URL: https://build.opensuse.org/package/show/devel:languages:perl/perl-Test-Log-Log4perl?expand=0&rev=1
This commit is contained in:
2018-10-07 21:44:28 +00:00
committed by Git OBS Bridge
commit b918b4e65e
5 changed files with 140 additions and 0 deletions

23
.gitattributes vendored Normal file
View File

@@ -0,0 +1,23 @@
## Default LFS
*.7z filter=lfs diff=lfs merge=lfs -text
*.bsp filter=lfs diff=lfs merge=lfs -text
*.bz2 filter=lfs diff=lfs merge=lfs -text
*.gem filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.jar filter=lfs diff=lfs merge=lfs -text
*.lz filter=lfs diff=lfs merge=lfs -text
*.lzma filter=lfs diff=lfs merge=lfs -text
*.obscpio filter=lfs diff=lfs merge=lfs -text
*.oxt filter=lfs diff=lfs merge=lfs -text
*.pdf filter=lfs diff=lfs merge=lfs -text
*.png filter=lfs diff=lfs merge=lfs -text
*.rpm filter=lfs diff=lfs merge=lfs -text
*.tbz filter=lfs diff=lfs merge=lfs -text
*.tbz2 filter=lfs diff=lfs merge=lfs -text
*.tgz filter=lfs diff=lfs merge=lfs -text
*.ttf filter=lfs diff=lfs merge=lfs -text
*.txz filter=lfs diff=lfs merge=lfs -text
*.whl filter=lfs diff=lfs merge=lfs -text
*.xz filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text
*.zst filter=lfs diff=lfs merge=lfs -text

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.osc

View File

@@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:23ebbb05893a05ebfe397fbce55152df8f9d6500125a8042f1aa6cfa93fc23c4
size 28530

View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Sun Oct 7 21:43:45 UTC 2018 - Dirk Stoecker <opensuse@dstoecker.de>
- Created

109
perl-Test-Log-Log4perl.spec Normal file
View File

@@ -0,0 +1,109 @@
#
# spec file for package perl-Test-Log-Log4perl
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: perl-Test-Log-Log4perl
Version: 0.32
Release: 0
%define cpan_name Test-Log-Log4perl
Summary: test log4perl
License: Artistic-1.0 or GPL-1.0+
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/Test-Log-Log4perl/
Source: http://www.cpan.org/authors/id/C/CL/CLKAO/%{cpan_name}-%{version}.tar.gz
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(Log::Log4perl)
BuildRequires: perl(Module::Install)
BuildRequires: perl(Test::Exception)
#BuildRequires: perl(inc::Module::Install)
#BuildRequires: perl(JSON)
#BuildRequires: perl(Log::Log4perl::Logger)
#BuildRequires: perl(LWP::Simple)
#BuildRequires: perl(Module::Build)
#BuildRequires: perl(Module::Install::Base)
#BuildRequires: perl(Parse::CPAN::Meta)
#BuildRequires: perl(Test::Log::Log4perl)
#BuildRequires: perl(YAML::Tiny)
Requires: perl(Log::Log4perl)
Requires: perl(Test::Exception)
%{perl_requires}
%description
This module can be used to test that you're logging the right thing with
Log::Log4perl. It checks that we get what, and only what, we expect logged
by your code.
The basic process is very simple. Within your test script you get one or
more loggers from *Test::Log::Log4perl* with the 'get_logger' method just
like you would with *Log::Log4perl*. You're going to use these loggers to
declare what you think the code you're going to test should be logging.
# declare a bunch of test loggers
my $tlogger = Test::Log::Log4perl->get_logger("Foo::Bar");
Then, for each test you want to do you need to start up the module.
# start the test
Test::Log::Log4perl->start();
This diverts all subsequent attempts *Log::Log4perl* makes to log stuff and
records them internally rather than passing them though to the Log4perl
appenders as normal.
You then need to declare with the loggers we created earlier what we hope
Log4perl will be asked to log. This is the same syntax as
Test::Log::Log4perl uses, except if you want you can use regular
expressions:
$tlogger->debug("fish");
$tlogger->warn(qr/bar/);
You then need to run your code that you're testing.
# call some code that hopefully will call the log4perl methods
# 'debug' with "fish" and 'warn' with something that contains 'bar'
some_code();
We finally need to tell *Test::Log4Perl* that we're done and it should do
the comparisons.
# start the test
Test::Log::Log4perl->end("test name");
%prep
%setup -q -n %{cpan_name}-%{version}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor
%{__make} %{?_smp_mflags}
%check
%{__make} test
%install
%perl_make_install
%perl_process_packlist
%perl_gen_filelist
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes MYMETA.json MYMETA.yml README
%changelog