From: Shlomi Fish Date: Sun, 12 Dec 2021 06:09:09 +0000 (+0200) Subject: optimize tests suite using parallelising X-Git-Tag: fortune-mod-3.8.0~8 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=67f657e69085c74be0bcd4b9e3fa4b4e5c01af1b;p=fortune-mod optimize tests suite using parallelising --- diff --git a/fortune-mod/tests/t/test-fortune-m--wetpaint.t b/fortune-mod/tests/t/test-fortune-m--wetpaint.t new file mode 100644 index 0000000..cfdcd45 --- /dev/null +++ b/fortune-mod/tests/t/test-fortune-m--wetpaint.t @@ -0,0 +1,26 @@ +#!/usr/bin/perl + +use strict; +use warnings; +use 5.014; + +use FindBin; +use lib "$FindBin::Bin/lib"; +use FortTestInst (); +use Test::More tests => 2; + +{ + my $inst_dir = FortTestInst::install("fortune-m--wpaint"); + my @cmd = ( $inst_dir->child( 'games', 'fortune' ), '-m', '"wet paint"' ); + + print "Running [@cmd]\n"; + my $text = `@cmd`; + my $rc = $?; + print "AfterRun rc=$rc [@cmd]\n"; + + # TEST + like( $text, qr/wet paint/, 'fortune -m matched' ); + + # TEST + unlike( $text, qr/wet paint.*?wet paint/ms, 'no duplicate fortunes' ); +} diff --git a/fortune-mod/tests/t/test-fortune-m.t b/fortune-mod/tests/t/test-fortune-m.t index d06f6ff..5df47d6 100644 --- a/fortune-mod/tests/t/test-fortune-m.t +++ b/fortune-mod/tests/t/test-fortune-m.t @@ -7,10 +7,10 @@ use 5.014; use FindBin; use lib "$FindBin::Bin/lib"; use FortTestInst (); -use Test::More tests => 3; +use Test::More tests => 1; { - my $inst_dir = FortTestInst::install("fortune-m"); + my $inst_dir = FortTestInst::install("fortune-m--giants"); my @cmd = ( $inst_dir->child( 'games', 'fortune' ), '-m', 'giants' ); print "Running [@cmd]\n"; @@ -21,19 +21,3 @@ use Test::More tests => 3; # TEST like( $text, qr/Newton/, 'fortune -m matched' ); } - -{ - my $inst_dir = FortTestInst::install("fortune-m"); - my @cmd = ( $inst_dir->child( 'games', 'fortune' ), '-m', '"wet paint"' ); - - print "Running [@cmd]\n"; - my $text = `@cmd`; - my $rc = $?; - print "AfterRun rc=$rc [@cmd]\n"; - - # TEST - like( $text, qr/wet paint/, 'fortune -m matched' ); - - # TEST - unlike( $text, qr/wet paint.*?wet paint/ms, 'no duplicate fortunes' ); -}