From 3a2914ed6396268c04dc50b8b119525f96ef83ab Mon Sep 17 00:00:00 2001 From: Mason James Date: Wed, 15 Nov 2017 20:37:45 +1300 Subject: [PATCH] Bug 18979: Swap threads for Test2::Suite Content-Type: text/plain; charset="utf-8" this patch swaps threads for the Test2::Suite module to test... 1/ apply patch 2/ install Test2::Suite $ sudo apt-get install libtest2-suite-perl , or... $ cpanm Test2::Suite 3/ run test $ sudo koha-shell -c " export PERL5LIB=/home/mason/git/koha/master; prove -v xt/author/valid-templates.t" kmaster ok 1 - Testing opac bootstrap templates { ... } ok 2 - Testing staff prog templates { ... } 1..2 ok All tests successful. Result: PASS 4. note test passes Result: PASS --- xt/author/valid-templates.t | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/xt/author/valid-templates.t b/xt/author/valid-templates.t index c9c439a..aec00c8 100644 --- a/xt/author/valid-templates.t +++ b/xt/author/valid-templates.t @@ -20,7 +20,9 @@ use strict; use warnings; -use threads; # used for parallel +use Test2::IPC; # load early +use Test2::Tools::Subtest qw/subtest_buffered/; + use Parallel::ForkManager; use Sys::CPU; @@ -34,7 +36,6 @@ This test checks all staff and OPAC templates and includes for syntax errors =cut - use File::Find; use File::Spec; use Template; @@ -80,7 +81,8 @@ my $pm = new Parallel::ForkManager($ncpu); # Tests foreach my $theme ( @themes ) { $pm->start and next; # do the fork - print "Testing $theme->{'type'} $theme->{'theme'} templates\n"; + + subtest_buffered "Testing $theme->{'type'} $theme->{'theme'} templates\n" => sub { if ( $theme->{'theme'} eq 'bootstrap' ) { run_template_test( $theme->{'modules'}, @@ -97,6 +99,8 @@ foreach my $theme ( @themes ) { $theme->{'includes'}, ); } + }; # ...end subtest + $pm->finish; } -- 2.1.4