| 1 |
package App::Yath::Converting; |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
our $VERSION = '1.000179'; |
| 6 |
|
| 7 |
1; |
| 8 |
|
| 9 |
__END__ |
| 10 |
|
| 11 |
=pod |
| 12 |
|
| 13 |
=encoding UTF-8 |
| 14 |
|
| 15 |
=head1 NAME |
| 16 |
|
| 17 |
App::Yath::Converting - Things you may need to change in your tests before you can use yath. |
| 18 |
|
| 19 |
=head1 NON-TAP FORMATTER |
| 20 |
|
| 21 |
By default yath tells any L<Test2> or L<Test::Builder> tests to use |
| 22 |
L<Test2::Formatter::Stream> instead of L<Test2::Formatter::TAP>. This is done |
| 23 |
in order to make sure as much data as possible makes it to yath, TAP is a lossy |
| 24 |
formatter by comparison. |
| 25 |
|
| 26 |
This is not normally a problem, but tests that do strange things with |
| 27 |
STDERR/STDOUT, or try to intercept output from the regular TAP formatter can |
| 28 |
have issues with this. |
| 29 |
|
| 30 |
=head2 SOLUTIONS |
| 31 |
|
| 32 |
=head3 HARNESS-NO-STREAM |
| 33 |
|
| 34 |
You can add a harness directive to the top of offending tests that tell the |
| 35 |
harness those specific tests should still use the TAP formatter. |
| 36 |
|
| 37 |
#!/usr/bin/perl |
| 38 |
# HARNESS-NO-STREAM |
| 39 |
... |
| 40 |
|
| 41 |
This directive can come after the C<#!> line, and after use statements, but |
| 42 |
must come BEFORE any empty lines or runtime statements. |
| 43 |
|
| 44 |
=head3 --no-stream |
| 45 |
|
| 46 |
You can run yath with the C<--no-stream> option, which will have tests default |
| 47 |
to TAP. This is not recommended as TAP is lossy. |
| 48 |
|
| 49 |
=head1 TESTS ARE RUN VIA FORK BY DEFAULT |
| 50 |
|
| 51 |
The default mode for yath is to preload a few things, then fork to spawn each |
| 52 |
test. This is a complicated procedure, and it uses L<goto::file> under the |
| 53 |
hood. Sometimes you have tests that simply will not work this way, or tests |
| 54 |
that verify specific libraries are not already loaded. |
| 55 |
|
| 56 |
=head2 SOLUTIONS |
| 57 |
|
| 58 |
=head3 HARNESS-NO-PRELOAD |
| 59 |
|
| 60 |
You can use this harness directive inside your tests to tell yath not to fork, |
| 61 |
but to instead launch a new perl process to run the test. |
| 62 |
|
| 63 |
#!/usr/bin/perl |
| 64 |
# HARNESS-NO-PRELOAD |
| 65 |
... |
| 66 |
|
| 67 |
=head3 --no-fork |
| 68 |
|
| 69 |
=head3 --no-preload |
| 70 |
|
| 71 |
Both these options tell yath not to preload+fork, but to run ALL tests in new |
| 72 |
processes. This is slow, it is better to mark specific tests that have issues |
| 73 |
in preload mode. |
| 74 |
|
| 75 |
=head1 SOURCE |
| 76 |
|
| 77 |
The source code repository for Test2-Harness can be found at |
| 78 |
F<http://github.com/Test-More/Test2-Harness/>. |
| 79 |
|
| 80 |
=head1 MAINTAINERS |
| 81 |
|
| 82 |
=over 4 |
| 83 |
|
| 84 |
=item Chad Granum E<lt>[email protected]<gt> |
| 85 |
|
| 86 |
=back |
| 87 |
|
| 88 |
=head1 AUTHORS |
| 89 |
|
| 90 |
=over 4 |
| 91 |
|
| 92 |
=item Chad Granum E<lt>[email protected]<gt> |
| 93 |
|
| 94 |
=back |
| 95 |
|
| 96 |
=head1 COPYRIGHT |
| 97 |
|
| 98 |
Copyright 2020 Chad Granum E<lt>[email protected]<gt>. |
| 99 |
|
| 100 |
This program is free software; you can redistribute it and/or |
| 101 |
modify it under the same terms as Perl itself. |
| 102 |
|
| 103 |
See F<http://dev.perl.org/licenses/> |
| 104 |
|
| 105 |
=cut |