exiftool-vendored.exe 12.82.0 → 12.82.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -0
- package/bin/exiftool.exe +0 -0
- package/bin/exiftool_files/Licenses_Strawberry_Perl.zip +0 -0
- package/bin/exiftool_files/lib/Archive/Zip/Archive.pm +399 -65
- package/bin/exiftool_files/lib/Archive/Zip/DirectoryMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/FileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/Member.pm +499 -195
- package/bin/exiftool_files/lib/Archive/Zip/NewFileMember.pm +1 -1
- package/bin/exiftool_files/lib/Archive/Zip/StringMember.pm +2 -2
- package/bin/exiftool_files/lib/Archive/Zip/ZipFileMember.pm +79 -20
- package/bin/exiftool_files/lib/Archive/Zip.pm +179 -29
- package/bin/exiftool_files/lib/AutoLoader.pm +453 -0
- package/bin/exiftool_files/lib/B/Deparse.pm +209 -137
- package/bin/exiftool_files/lib/B.pm +1 -1
- package/bin/exiftool_files/lib/Benchmark.pm +1123 -0
- package/bin/exiftool_files/lib/Class/Struct.pm +2 -2
- package/bin/exiftool_files/lib/Compress/Raw/Bzip2.pm +14 -9
- package/bin/exiftool_files/lib/Compress/Raw/Lzma.pm +982 -0
- package/bin/exiftool_files/lib/Compress/Raw/Zlib.pm +91 -86
- package/bin/exiftool_files/lib/Compress/Zlib.pm +105 -100
- package/bin/exiftool_files/lib/Config.pm +9 -9
- package/bin/exiftool_files/lib/Config_heavy.pl +36 -33
- package/bin/exiftool_files/lib/CryptX.pm +2 -82
- package/bin/exiftool_files/lib/Data/Dumper.pm +2 -2
- package/bin/exiftool_files/lib/Digest/MD5.pm +12 -9
- package/bin/exiftool_files/lib/Digest/Perl/MD5.pm +1 -191
- package/bin/exiftool_files/lib/Digest/base.pm +26 -20
- package/bin/exiftool_files/lib/DynaLoader.pm +7 -4
- package/bin/exiftool_files/lib/Encode.pm +3 -3
- package/bin/exiftool_files/lib/Errno.pm +13 -13
- package/bin/exiftool_files/lib/Exporter/Heavy.pm +2 -2
- package/bin/exiftool_files/lib/Exporter.pm +1 -1
- package/bin/exiftool_files/lib/ExtUtils/Command/MM.pm +323 -0
- package/bin/exiftool_files/lib/ExtUtils/Command.pm +382 -0
- package/bin/exiftool_files/lib/File/Find.pm +1 -1
- package/bin/exiftool_files/lib/File/Glob.pm +1 -8
- package/bin/exiftool_files/lib/File/GlobMapper.pm +2 -2
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Carbon.pm +2 -40
- package/bin/exiftool_files/lib/File/HomeDir/Darwin/Cocoa.pm +2 -34
- package/bin/exiftool_files/lib/File/HomeDir/Darwin.pm +2 -28
- package/bin/exiftool_files/lib/File/HomeDir/Driver.pm +2 -35
- package/bin/exiftool_files/lib/File/HomeDir/FreeDesktop.pm +2 -62
- package/bin/exiftool_files/lib/File/HomeDir/MacOS9.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Test.pm +2 -43
- package/bin/exiftool_files/lib/File/HomeDir/Unix.pm +2 -53
- package/bin/exiftool_files/lib/File/HomeDir/Windows.pm +2 -69
- package/bin/exiftool_files/lib/File/HomeDir.pm +5 -416
- package/bin/exiftool_files/lib/File/Path.pm +3 -3
- package/bin/exiftool_files/lib/File/Spec/Win32.pm +2 -2
- package/bin/exiftool_files/lib/File/Temp.pm +70 -35
- package/bin/exiftool_files/lib/File/Which.pm +1 -240
- package/bin/exiftool_files/lib/File/stat.pm +3 -2
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Bzip2.pm +16 -17
- package/bin/exiftool_files/lib/IO/Compress/Adapter/Deflate.pm +19 -20
- package/bin/exiftool_files/lib/IO/Compress/Base/Common.pm +5 -5
- package/bin/exiftool_files/lib/IO/Compress/Base.pm +35 -26
- package/bin/exiftool_files/lib/IO/Compress/Brotli.pm +159 -0
- package/bin/exiftool_files/lib/IO/Compress/Bzip2.pm +50 -25
- package/bin/exiftool_files/lib/IO/Compress/Gzip/Constants.pm +6 -6
- package/bin/exiftool_files/lib/IO/Compress/Gzip.pm +58 -32
- package/bin/exiftool_files/lib/IO/Compress/RawDeflate.pm +63 -38
- package/bin/exiftool_files/lib/IO/Compress/Zlib/Extra.pm +20 -20
- package/bin/exiftool_files/lib/IO/Dir.pm +1 -1
- package/bin/exiftool_files/lib/IO/File.pm +1 -1
- package/bin/exiftool_files/lib/IO/Handle.pm +1 -21
- package/bin/exiftool_files/lib/IO/Pipe.pm +1 -1
- package/bin/exiftool_files/lib/IO/Seekable.pm +1 -1
- package/bin/exiftool_files/lib/IO/Select.pm +16 -2
- package/bin/exiftool_files/lib/IO/Socket/INET.pm +14 -9
- package/bin/exiftool_files/lib/IO/Socket/UNIX.pm +17 -1
- package/bin/exiftool_files/lib/IO/Socket.pm +474 -126
- package/bin/exiftool_files/lib/IO/String.pm +425 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Adapter/Inflate.pm +13 -14
- package/bin/exiftool_files/lib/IO/Uncompress/Base.pm +142 -132
- package/bin/exiftool_files/lib/IO/Uncompress/Brotli.pm +119 -0
- package/bin/exiftool_files/lib/IO/Uncompress/Gunzip.pm +43 -37
- package/bin/exiftool_files/lib/IO/Uncompress/RawInflate.pm +49 -43
- package/bin/exiftool_files/lib/IO.pm +2 -2
- package/bin/exiftool_files/lib/List/Util.pm +97 -8
- package/bin/exiftool_files/lib/MIME/Base64.pm +5 -5
- package/bin/exiftool_files/lib/MIME/Charset/_Compat.pm +106 -0
- package/bin/exiftool_files/lib/MIME/Charset.pm +1303 -0
- package/bin/exiftool_files/lib/Math/BigFloat.pm +444 -27
- package/bin/exiftool_files/lib/Math/BigInt/Calc.pm +296 -313
- package/bin/exiftool_files/lib/Math/BigInt/FastCalc.pm +1 -1
- package/bin/exiftool_files/lib/Math/BigInt/GMP.pm +2 -115
- package/bin/exiftool_files/lib/Math/BigInt/LTM.pm +2 -24
- package/bin/exiftool_files/lib/Math/BigInt/Lib.pm +61 -32
- package/bin/exiftool_files/lib/Math/BigInt.pm +292 -107
- package/bin/exiftool_files/lib/POSIX.pm +1 -1
- package/bin/exiftool_files/lib/PerlIO/scalar.pm +41 -0
- package/bin/exiftool_files/lib/PerlIO.pm +397 -0
- package/bin/exiftool_files/lib/Portable/CPAN.pm +94 -94
- package/bin/exiftool_files/lib/Portable/Config.pm +94 -94
- package/bin/exiftool_files/lib/Portable/FileSpec.pm +180 -180
- package/bin/exiftool_files/lib/Portable/HomeDir.pm +110 -110
- package/bin/exiftool_files/lib/Portable/LoadYaml.pm +430 -430
- package/bin/exiftool_files/lib/Portable/minicpan.pm +55 -55
- package/bin/exiftool_files/lib/Portable.pm +246 -320
- package/bin/exiftool_files/lib/Scalar/Util.pm +9 -4
- package/bin/exiftool_files/lib/Socket.pm +16 -12
- package/bin/exiftool_files/lib/Storable.pm +1444 -1441
- package/bin/exiftool_files/lib/TAP/Base.pm +133 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Base.pm +467 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Color.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/ParallelSession.pm +201 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console/Session.pm +205 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Console.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File/Session.pm +95 -0
- package/bin/exiftool_files/lib/TAP/Formatter/File.pm +56 -0
- package/bin/exiftool_files/lib/TAP/Formatter/Session.pm +220 -0
- package/bin/exiftool_files/lib/TAP/Harness/Beyond.pod +426 -0
- package/bin/exiftool_files/lib/TAP/Harness/Env.pm +215 -0
- package/bin/exiftool_files/lib/TAP/Harness.pm +1054 -0
- package/bin/exiftool_files/lib/TAP/Object.pm +155 -0
- package/bin/exiftool_files/lib/TAP/Parser/Aggregator.pm +414 -0
- package/bin/exiftool_files/lib/TAP/Parser/Grammar.pm +584 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Array.pm +100 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Process.pm +378 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator/Stream.pm +116 -0
- package/bin/exiftool_files/lib/TAP/Parser/Iterator.pm +162 -0
- package/bin/exiftool_files/lib/TAP/Parser/IteratorFactory.pm +339 -0
- package/bin/exiftool_files/lib/TAP/Parser/Multiplexer.pm +194 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Bailout.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Comment.pm +60 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Plan.pm +119 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Pragma.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Test.pm +271 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Unknown.pm +48 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/Version.pm +62 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result/YAML.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Result.pm +297 -0
- package/bin/exiftool_files/lib/TAP/Parser/ResultFactory.pm +183 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Job.pm +127 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler/Spinner.pm +61 -0
- package/bin/exiftool_files/lib/TAP/Parser/Scheduler.pm +448 -0
- package/bin/exiftool_files/lib/TAP/Parser/Source.pm +381 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Executable.pm +184 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/File.pm +136 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Handle.pm +124 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/Perl.pm +370 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler/RawTAP.pm +130 -0
- package/bin/exiftool_files/lib/TAP/Parser/SourceHandler.pm +191 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Reader.pm +332 -0
- package/bin/exiftool_files/lib/TAP/Parser/YAMLish/Writer.pm +254 -0
- package/bin/exiftool_files/lib/TAP/Parser.pm +1931 -0
- package/bin/exiftool_files/lib/Test/Builder/Formatter.pm +107 -0
- package/bin/exiftool_files/lib/Test/Builder/IO/Scalar.pm +659 -0
- package/bin/exiftool_files/lib/Test/Builder/Module.pm +182 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester/Color.pm +51 -0
- package/bin/exiftool_files/lib/Test/Builder/Tester.pm +675 -0
- package/bin/exiftool_files/lib/Test/Builder/TodoDiag.pm +68 -0
- package/bin/exiftool_files/lib/Test/Builder.pm +2653 -0
- package/bin/exiftool_files/lib/Test/Harness.pm +618 -0
- package/bin/exiftool_files/lib/Test/More.pm +1997 -0
- package/bin/exiftool_files/lib/Test/Simple.pm +220 -0
- package/bin/exiftool_files/lib/Test/Tester/Capture.pm +241 -0
- package/bin/exiftool_files/lib/Test/Tester/CaptureRunner.pm +79 -0
- package/bin/exiftool_files/lib/Test/Tester/Delegate.pm +45 -0
- package/bin/exiftool_files/lib/Test/Tester.pm +695 -0
- package/bin/exiftool_files/lib/Test/Tutorial.pod +618 -0
- package/bin/exiftool_files/lib/Test/use/ok.pm +64 -0
- package/bin/exiftool_files/lib/Text/ParseWords.pm +303 -0
- package/bin/exiftool_files/lib/Tie/StdHandle.pm +2 -2
- package/bin/exiftool_files/lib/Time/HiRes.pm +73 -68
- package/bin/exiftool_files/lib/Time/Local.pm +82 -35
- package/bin/exiftool_files/lib/Time/Piece.pm +19 -4
- package/bin/exiftool_files/lib/Time/Seconds.pm +1 -1
- package/bin/exiftool_files/lib/UNIVERSAL.pm +203 -0
- package/bin/exiftool_files/lib/Unicode/GCString.pm +60 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak/Constants.pm +68 -0
- package/bin/exiftool_files/lib/Unicode/LineBreak.pm +248 -0
- package/bin/exiftool_files/lib/Win32/API/Struct.pm +1 -177
- package/bin/exiftool_files/lib/Win32/API/Type.pm +1 -100
- package/bin/exiftool_files/lib/Win32/API.pm +1 -830
- package/bin/exiftool_files/lib/Win32/FindFile.pm +2 -123
- package/bin/exiftool_files/lib/Win32.pm +213 -89
- package/bin/exiftool_files/lib/Win32API/File.pm +1 -1
- package/bin/exiftool_files/lib/auto/B/B.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Bzip2/Bzip2.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/Lzma.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Lzma/autosplit.ix +3 -0
- package/bin/exiftool_files/lib/auto/Compress/Raw/Zlib/Zlib.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/CryptX/CryptX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Cwd/Cwd.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Data/Dumper/Dumper.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/MD5/MD5.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Digest/SHA/SHA.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Encode/Encode.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Fcntl/Fcntl.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/File/Glob/Glob.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/Compress/Brotli/Brotli.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/IO/IO.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/List/Util/Util.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/MIME/Base64/Base64.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/FastCalc/FastCalc.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Math/BigInt/GMP/GMP.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/POSIX/POSIX.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/PerlIO/scalar/scalar.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Socket/Socket.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Storable/Storable.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/HiRes/HiRes.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Time/Piece/Piece.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Unicode/LineBreak/LineBreak.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/API/API.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/FindFile/FindFile.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32/Win32.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/Win32API/File/File.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/mro/mro.xs.dll +0 -0
- package/bin/exiftool_files/lib/auto/re/re.xs.dll +0 -0
- package/bin/exiftool_files/lib/feature.pm +49 -17
- package/bin/exiftool_files/lib/mro.pm +4 -20
- package/bin/exiftool_files/lib/overload.pm +15 -15
- package/bin/exiftool_files/lib/parent.pm +10 -2
- package/bin/exiftool_files/lib/re.pm +91 -33
- package/bin/exiftool_files/lib/warnings.pm +17 -6
- package/bin/exiftool_files/libgcc_s_seh-1.dll +0 -0
- package/bin/exiftool_files/liblzma-5__.dll +0 -0
- package/bin/exiftool_files/libstdc++-6.dll +0 -0
- package/bin/exiftool_files/libwinpthread-1.dll +0 -0
- package/bin/exiftool_files/perl.exe +0 -0
- package/bin/exiftool_files/perl532.dll +0 -0
- package/package.json +5 -3
- package/bin/exiftool_files/libgcc_s_dw2-1.dll +0 -0
- package/bin/exiftool_files/perl530.dll +0 -0
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
package TAP::Parser::Result;
|
|
2
|
+
|
|
3
|
+
use strict;
|
|
4
|
+
use warnings;
|
|
5
|
+
|
|
6
|
+
use base 'TAP::Object';
|
|
7
|
+
|
|
8
|
+
BEGIN {
|
|
9
|
+
|
|
10
|
+
# make is_* methods
|
|
11
|
+
my @attrs = qw( plan pragma test comment bailout version unknown yaml );
|
|
12
|
+
no strict 'refs';
|
|
13
|
+
for my $token (@attrs) {
|
|
14
|
+
my $method = "is_$token";
|
|
15
|
+
*$method = sub { return $token eq shift->type };
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
##############################################################################
|
|
20
|
+
|
|
21
|
+
=head1 NAME
|
|
22
|
+
|
|
23
|
+
TAP::Parser::Result - Base class for TAP::Parser output objects
|
|
24
|
+
|
|
25
|
+
=head1 VERSION
|
|
26
|
+
|
|
27
|
+
Version 3.42
|
|
28
|
+
|
|
29
|
+
=cut
|
|
30
|
+
|
|
31
|
+
our $VERSION = '3.42';
|
|
32
|
+
|
|
33
|
+
=head1 SYNOPSIS
|
|
34
|
+
|
|
35
|
+
# abstract class - not meant to be used directly
|
|
36
|
+
# see TAP::Parser::ResultFactory for preferred usage
|
|
37
|
+
|
|
38
|
+
# directly:
|
|
39
|
+
use TAP::Parser::Result;
|
|
40
|
+
my $token = {...};
|
|
41
|
+
my $result = TAP::Parser::Result->new( $token );
|
|
42
|
+
|
|
43
|
+
=head2 DESCRIPTION
|
|
44
|
+
|
|
45
|
+
This is a simple base class used by L<TAP::Parser> to store objects that
|
|
46
|
+
represent the current bit of test output data from TAP (usually a single
|
|
47
|
+
line). Unless you're subclassing, you probably won't need to use this module
|
|
48
|
+
directly.
|
|
49
|
+
|
|
50
|
+
=head2 METHODS
|
|
51
|
+
|
|
52
|
+
=head3 C<new>
|
|
53
|
+
|
|
54
|
+
# see TAP::Parser::ResultFactory for preferred usage
|
|
55
|
+
|
|
56
|
+
# to use directly:
|
|
57
|
+
my $result = TAP::Parser::Result->new($token);
|
|
58
|
+
|
|
59
|
+
Returns an instance the appropriate class for the test token passed in.
|
|
60
|
+
|
|
61
|
+
=cut
|
|
62
|
+
|
|
63
|
+
# new() implementation provided by TAP::Object
|
|
64
|
+
|
|
65
|
+
sub _initialize {
|
|
66
|
+
my ( $self, $token ) = @_;
|
|
67
|
+
if ($token) {
|
|
68
|
+
|
|
69
|
+
# assign to a hash slice to make a shallow copy of the token.
|
|
70
|
+
# I guess we could assign to the hash as (by default) there are not
|
|
71
|
+
# contents, but that seems less helpful if someone wants to subclass us
|
|
72
|
+
@{$self}{ keys %$token } = values %$token;
|
|
73
|
+
}
|
|
74
|
+
return $self;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
##############################################################################
|
|
78
|
+
|
|
79
|
+
=head2 Boolean methods
|
|
80
|
+
|
|
81
|
+
The following methods all return a boolean value and are to be overridden in
|
|
82
|
+
the appropriate subclass.
|
|
83
|
+
|
|
84
|
+
=over 4
|
|
85
|
+
|
|
86
|
+
=item * C<is_plan>
|
|
87
|
+
|
|
88
|
+
Indicates whether or not this is the test plan line.
|
|
89
|
+
|
|
90
|
+
1..3
|
|
91
|
+
|
|
92
|
+
=item * C<is_pragma>
|
|
93
|
+
|
|
94
|
+
Indicates whether or not this is a pragma line.
|
|
95
|
+
|
|
96
|
+
pragma +strict
|
|
97
|
+
|
|
98
|
+
=item * C<is_test>
|
|
99
|
+
|
|
100
|
+
Indicates whether or not this is a test line.
|
|
101
|
+
|
|
102
|
+
ok 1 Is OK!
|
|
103
|
+
|
|
104
|
+
=item * C<is_comment>
|
|
105
|
+
|
|
106
|
+
Indicates whether or not this is a comment.
|
|
107
|
+
|
|
108
|
+
# this is a comment
|
|
109
|
+
|
|
110
|
+
=item * C<is_bailout>
|
|
111
|
+
|
|
112
|
+
Indicates whether or not this is bailout line.
|
|
113
|
+
|
|
114
|
+
Bail out! We're out of dilithium crystals.
|
|
115
|
+
|
|
116
|
+
=item * C<is_version>
|
|
117
|
+
|
|
118
|
+
Indicates whether or not this is a TAP version line.
|
|
119
|
+
|
|
120
|
+
TAP version 4
|
|
121
|
+
|
|
122
|
+
=item * C<is_unknown>
|
|
123
|
+
|
|
124
|
+
Indicates whether or not the current line could be parsed.
|
|
125
|
+
|
|
126
|
+
... this line is junk ...
|
|
127
|
+
|
|
128
|
+
=item * C<is_yaml>
|
|
129
|
+
|
|
130
|
+
Indicates whether or not this is a YAML chunk.
|
|
131
|
+
|
|
132
|
+
=back
|
|
133
|
+
|
|
134
|
+
=cut
|
|
135
|
+
|
|
136
|
+
##############################################################################
|
|
137
|
+
|
|
138
|
+
=head3 C<raw>
|
|
139
|
+
|
|
140
|
+
print $result->raw;
|
|
141
|
+
|
|
142
|
+
Returns the original line of text which was parsed.
|
|
143
|
+
|
|
144
|
+
=cut
|
|
145
|
+
|
|
146
|
+
sub raw { shift->{raw} }
|
|
147
|
+
|
|
148
|
+
##############################################################################
|
|
149
|
+
|
|
150
|
+
=head3 C<type>
|
|
151
|
+
|
|
152
|
+
my $type = $result->type;
|
|
153
|
+
|
|
154
|
+
Returns the "type" of a token, such as C<comment> or C<test>.
|
|
155
|
+
|
|
156
|
+
=cut
|
|
157
|
+
|
|
158
|
+
sub type { shift->{type} }
|
|
159
|
+
|
|
160
|
+
##############################################################################
|
|
161
|
+
|
|
162
|
+
=head3 C<as_string>
|
|
163
|
+
|
|
164
|
+
print $result->as_string;
|
|
165
|
+
|
|
166
|
+
Prints a string representation of the token. This might not be the exact
|
|
167
|
+
output, however. Tests will have test numbers added if not present, TODO and
|
|
168
|
+
SKIP directives will be capitalized and, in general, things will be cleaned
|
|
169
|
+
up. If you need the original text for the token, see the C<raw> method.
|
|
170
|
+
|
|
171
|
+
=cut
|
|
172
|
+
|
|
173
|
+
sub as_string { shift->{raw} }
|
|
174
|
+
|
|
175
|
+
##############################################################################
|
|
176
|
+
|
|
177
|
+
=head3 C<is_ok>
|
|
178
|
+
|
|
179
|
+
if ( $result->is_ok ) { ... }
|
|
180
|
+
|
|
181
|
+
Reports whether or not a given result has passed. Anything which is B<not> a
|
|
182
|
+
test result returns true. This is merely provided as a convenient shortcut.
|
|
183
|
+
|
|
184
|
+
=cut
|
|
185
|
+
|
|
186
|
+
sub is_ok {1}
|
|
187
|
+
|
|
188
|
+
##############################################################################
|
|
189
|
+
|
|
190
|
+
=head3 C<passed>
|
|
191
|
+
|
|
192
|
+
Deprecated. Please use C<is_ok> instead.
|
|
193
|
+
|
|
194
|
+
=cut
|
|
195
|
+
|
|
196
|
+
sub passed {
|
|
197
|
+
warn 'passed() is deprecated. Please use "is_ok()"';
|
|
198
|
+
shift->is_ok;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
##############################################################################
|
|
202
|
+
|
|
203
|
+
=head3 C<has_directive>
|
|
204
|
+
|
|
205
|
+
if ( $result->has_directive ) {
|
|
206
|
+
...
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
Indicates whether or not the given result has a TODO or SKIP directive.
|
|
210
|
+
|
|
211
|
+
=cut
|
|
212
|
+
|
|
213
|
+
sub has_directive {
|
|
214
|
+
my $self = shift;
|
|
215
|
+
return ( $self->has_todo || $self->has_skip );
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
##############################################################################
|
|
219
|
+
|
|
220
|
+
=head3 C<has_todo>
|
|
221
|
+
|
|
222
|
+
if ( $result->has_todo ) {
|
|
223
|
+
...
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
Indicates whether or not the given result has a TODO directive.
|
|
227
|
+
|
|
228
|
+
=cut
|
|
229
|
+
|
|
230
|
+
sub has_todo { 'TODO' eq ( shift->{directive} || '' ) }
|
|
231
|
+
|
|
232
|
+
##############################################################################
|
|
233
|
+
|
|
234
|
+
=head3 C<has_skip>
|
|
235
|
+
|
|
236
|
+
if ( $result->has_skip ) {
|
|
237
|
+
...
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
Indicates whether or not the given result has a SKIP directive.
|
|
241
|
+
|
|
242
|
+
=cut
|
|
243
|
+
|
|
244
|
+
sub has_skip { 'SKIP' eq ( shift->{directive} || '' ) }
|
|
245
|
+
|
|
246
|
+
=head3 C<set_directive>
|
|
247
|
+
|
|
248
|
+
Set the directive associated with this token. Used internally to fake
|
|
249
|
+
TODO tests.
|
|
250
|
+
|
|
251
|
+
=cut
|
|
252
|
+
|
|
253
|
+
sub set_directive {
|
|
254
|
+
my ( $self, $dir ) = @_;
|
|
255
|
+
$self->{directive} = $dir;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
1;
|
|
259
|
+
|
|
260
|
+
=head1 SUBCLASSING
|
|
261
|
+
|
|
262
|
+
Please see L<TAP::Parser/SUBCLASSING> for a subclassing overview.
|
|
263
|
+
|
|
264
|
+
Remember: if you want your subclass to be automatically used by the parser,
|
|
265
|
+
you'll have to register it with L<TAP::Parser::ResultFactory/register_type>.
|
|
266
|
+
|
|
267
|
+
If you're creating a completely new result I<type>, you'll probably need to
|
|
268
|
+
subclass L<TAP::Parser::Grammar> too, or else it'll never get used.
|
|
269
|
+
|
|
270
|
+
=head2 Example
|
|
271
|
+
|
|
272
|
+
package MyResult;
|
|
273
|
+
|
|
274
|
+
use strict;
|
|
275
|
+
|
|
276
|
+
use base 'TAP::Parser::Result';
|
|
277
|
+
|
|
278
|
+
# register with the factory:
|
|
279
|
+
TAP::Parser::ResultFactory->register_type( 'my_type' => __PACKAGE__ );
|
|
280
|
+
|
|
281
|
+
sub as_string { 'My results all look the same' }
|
|
282
|
+
|
|
283
|
+
=head1 SEE ALSO
|
|
284
|
+
|
|
285
|
+
L<TAP::Object>,
|
|
286
|
+
L<TAP::Parser>,
|
|
287
|
+
L<TAP::Parser::ResultFactory>,
|
|
288
|
+
L<TAP::Parser::Result::Bailout>,
|
|
289
|
+
L<TAP::Parser::Result::Comment>,
|
|
290
|
+
L<TAP::Parser::Result::Plan>,
|
|
291
|
+
L<TAP::Parser::Result::Pragma>,
|
|
292
|
+
L<TAP::Parser::Result::Test>,
|
|
293
|
+
L<TAP::Parser::Result::Unknown>,
|
|
294
|
+
L<TAP::Parser::Result::Version>,
|
|
295
|
+
L<TAP::Parser::Result::YAML>,
|
|
296
|
+
|
|
297
|
+
=cut
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
package TAP::Parser::ResultFactory;
|
|
2
|
+
|
|
3
|
+
use strict;
|
|
4
|
+
use warnings;
|
|
5
|
+
|
|
6
|
+
use TAP::Parser::Result::Bailout ();
|
|
7
|
+
use TAP::Parser::Result::Comment ();
|
|
8
|
+
use TAP::Parser::Result::Plan ();
|
|
9
|
+
use TAP::Parser::Result::Pragma ();
|
|
10
|
+
use TAP::Parser::Result::Test ();
|
|
11
|
+
use TAP::Parser::Result::Unknown ();
|
|
12
|
+
use TAP::Parser::Result::Version ();
|
|
13
|
+
use TAP::Parser::Result::YAML ();
|
|
14
|
+
|
|
15
|
+
use base 'TAP::Object';
|
|
16
|
+
|
|
17
|
+
##############################################################################
|
|
18
|
+
|
|
19
|
+
=head1 NAME
|
|
20
|
+
|
|
21
|
+
TAP::Parser::ResultFactory - Factory for creating TAP::Parser output objects
|
|
22
|
+
|
|
23
|
+
=head1 SYNOPSIS
|
|
24
|
+
|
|
25
|
+
use TAP::Parser::ResultFactory;
|
|
26
|
+
my $token = {...};
|
|
27
|
+
my $factory = TAP::Parser::ResultFactory->new;
|
|
28
|
+
my $result = $factory->make_result( $token );
|
|
29
|
+
|
|
30
|
+
=head1 VERSION
|
|
31
|
+
|
|
32
|
+
Version 3.42
|
|
33
|
+
|
|
34
|
+
=cut
|
|
35
|
+
|
|
36
|
+
our $VERSION = '3.42';
|
|
37
|
+
|
|
38
|
+
=head2 DESCRIPTION
|
|
39
|
+
|
|
40
|
+
This is a simple factory class which returns a L<TAP::Parser::Result> subclass
|
|
41
|
+
representing the current bit of test data from TAP (usually a single line).
|
|
42
|
+
It is used primarily by L<TAP::Parser::Grammar>. Unless you're subclassing,
|
|
43
|
+
you probably won't need to use this module directly.
|
|
44
|
+
|
|
45
|
+
=head2 METHODS
|
|
46
|
+
|
|
47
|
+
=head2 Class Methods
|
|
48
|
+
|
|
49
|
+
=head3 C<new>
|
|
50
|
+
|
|
51
|
+
Creates a new factory class.
|
|
52
|
+
I<Note:> You currently don't need to instantiate a factory in order to use it.
|
|
53
|
+
|
|
54
|
+
=head3 C<make_result>
|
|
55
|
+
|
|
56
|
+
Returns an instance the appropriate class for the test token passed in.
|
|
57
|
+
|
|
58
|
+
my $result = TAP::Parser::ResultFactory->make_result($token);
|
|
59
|
+
|
|
60
|
+
Can also be called as an instance method.
|
|
61
|
+
|
|
62
|
+
=cut
|
|
63
|
+
|
|
64
|
+
sub make_result {
|
|
65
|
+
my ( $proto, $token ) = @_;
|
|
66
|
+
my $type = $token->{type};
|
|
67
|
+
return $proto->class_for($type)->new($token);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
=head3 C<class_for>
|
|
71
|
+
|
|
72
|
+
Takes one argument: C<$type>. Returns the class for this $type, or C<croak>s
|
|
73
|
+
with an error.
|
|
74
|
+
|
|
75
|
+
=head3 C<register_type>
|
|
76
|
+
|
|
77
|
+
Takes two arguments: C<$type>, C<$class>
|
|
78
|
+
|
|
79
|
+
This lets you override an existing type with your own custom type, or register
|
|
80
|
+
a completely new type, eg:
|
|
81
|
+
|
|
82
|
+
# create a custom result type:
|
|
83
|
+
package MyResult;
|
|
84
|
+
use strict;
|
|
85
|
+
use base 'TAP::Parser::Result';
|
|
86
|
+
|
|
87
|
+
# register with the factory:
|
|
88
|
+
TAP::Parser::ResultFactory->register_type( 'my_type' => __PACKAGE__ );
|
|
89
|
+
|
|
90
|
+
# use it:
|
|
91
|
+
my $r = TAP::Parser::ResultFactory->( { type => 'my_type' } );
|
|
92
|
+
|
|
93
|
+
Your custom type should then be picked up automatically by the L<TAP::Parser>.
|
|
94
|
+
|
|
95
|
+
=cut
|
|
96
|
+
|
|
97
|
+
our %CLASS_FOR = (
|
|
98
|
+
plan => 'TAP::Parser::Result::Plan',
|
|
99
|
+
pragma => 'TAP::Parser::Result::Pragma',
|
|
100
|
+
test => 'TAP::Parser::Result::Test',
|
|
101
|
+
comment => 'TAP::Parser::Result::Comment',
|
|
102
|
+
bailout => 'TAP::Parser::Result::Bailout',
|
|
103
|
+
version => 'TAP::Parser::Result::Version',
|
|
104
|
+
unknown => 'TAP::Parser::Result::Unknown',
|
|
105
|
+
yaml => 'TAP::Parser::Result::YAML',
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
sub class_for {
|
|
109
|
+
my ( $class, $type ) = @_;
|
|
110
|
+
|
|
111
|
+
# return target class:
|
|
112
|
+
return $CLASS_FOR{$type} if exists $CLASS_FOR{$type};
|
|
113
|
+
|
|
114
|
+
# or complain:
|
|
115
|
+
require Carp;
|
|
116
|
+
Carp::croak("Could not determine class for result type '$type'");
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
sub register_type {
|
|
120
|
+
my ( $class, $type, $rclass ) = @_;
|
|
121
|
+
|
|
122
|
+
# register it blindly, assume they know what they're doing
|
|
123
|
+
$CLASS_FOR{$type} = $rclass;
|
|
124
|
+
return $class;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
1;
|
|
128
|
+
|
|
129
|
+
=head1 SUBCLASSING
|
|
130
|
+
|
|
131
|
+
Please see L<TAP::Parser/SUBCLASSING> for a subclassing overview.
|
|
132
|
+
|
|
133
|
+
There are a few things to bear in mind when creating your own
|
|
134
|
+
C<ResultFactory>:
|
|
135
|
+
|
|
136
|
+
=over 4
|
|
137
|
+
|
|
138
|
+
=item 1
|
|
139
|
+
|
|
140
|
+
The factory itself is never instantiated (this I<may> change in the future).
|
|
141
|
+
This means that C<_initialize> is never called.
|
|
142
|
+
|
|
143
|
+
=item 2
|
|
144
|
+
|
|
145
|
+
C<TAP::Parser::Result-E<gt>new> is never called, $tokens are reblessed.
|
|
146
|
+
This I<will> change in a future version!
|
|
147
|
+
|
|
148
|
+
=item 3
|
|
149
|
+
|
|
150
|
+
L<TAP::Parser::Result> subclasses will register themselves with
|
|
151
|
+
L<TAP::Parser::ResultFactory> directly:
|
|
152
|
+
|
|
153
|
+
package MyFooResult;
|
|
154
|
+
TAP::Parser::ResultFactory->register_type( foo => __PACKAGE__ );
|
|
155
|
+
|
|
156
|
+
Of course, it's up to you to decide whether or not to ignore them.
|
|
157
|
+
|
|
158
|
+
=back
|
|
159
|
+
|
|
160
|
+
=head2 Example
|
|
161
|
+
|
|
162
|
+
package MyResultFactory;
|
|
163
|
+
|
|
164
|
+
use strict;
|
|
165
|
+
|
|
166
|
+
use MyResult;
|
|
167
|
+
|
|
168
|
+
use base 'TAP::Parser::ResultFactory';
|
|
169
|
+
|
|
170
|
+
# force all results to be 'MyResult'
|
|
171
|
+
sub class_for {
|
|
172
|
+
return 'MyResult';
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
1;
|
|
176
|
+
|
|
177
|
+
=head1 SEE ALSO
|
|
178
|
+
|
|
179
|
+
L<TAP::Parser>,
|
|
180
|
+
L<TAP::Parser::Result>,
|
|
181
|
+
L<TAP::Parser::Grammar>
|
|
182
|
+
|
|
183
|
+
=cut
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
package TAP::Parser::Scheduler::Job;
|
|
2
|
+
|
|
3
|
+
use strict;
|
|
4
|
+
use warnings;
|
|
5
|
+
use Carp;
|
|
6
|
+
|
|
7
|
+
=head1 NAME
|
|
8
|
+
|
|
9
|
+
TAP::Parser::Scheduler::Job - A single testing job.
|
|
10
|
+
|
|
11
|
+
=head1 VERSION
|
|
12
|
+
|
|
13
|
+
Version 3.42
|
|
14
|
+
|
|
15
|
+
=cut
|
|
16
|
+
|
|
17
|
+
our $VERSION = '3.42';
|
|
18
|
+
|
|
19
|
+
=head1 SYNOPSIS
|
|
20
|
+
|
|
21
|
+
use TAP::Parser::Scheduler::Job;
|
|
22
|
+
|
|
23
|
+
=head1 DESCRIPTION
|
|
24
|
+
|
|
25
|
+
Represents a single test 'job'.
|
|
26
|
+
|
|
27
|
+
=head1 METHODS
|
|
28
|
+
|
|
29
|
+
=head2 Class Methods
|
|
30
|
+
|
|
31
|
+
=head3 C<new>
|
|
32
|
+
|
|
33
|
+
my $job = TAP::Parser::Scheduler::Job->new(
|
|
34
|
+
$filename, $description
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
Given the filename and description of a test as scalars, returns a new
|
|
38
|
+
L<TAP::Parser::Scheduler::Job> object.
|
|
39
|
+
|
|
40
|
+
=cut
|
|
41
|
+
|
|
42
|
+
sub new {
|
|
43
|
+
my ( $class, $name, $desc, @ctx ) = @_;
|
|
44
|
+
return bless {
|
|
45
|
+
filename => $name,
|
|
46
|
+
description => $desc,
|
|
47
|
+
@ctx ? ( context => \@ctx ) : (),
|
|
48
|
+
}, $class;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
=head2 Instance Methods
|
|
52
|
+
|
|
53
|
+
=head3 C<on_finish>
|
|
54
|
+
|
|
55
|
+
$self->on_finish(\&method).
|
|
56
|
+
|
|
57
|
+
Register a closure to be called when this job is destroyed. The callback
|
|
58
|
+
will be passed the C<TAP::Parser::Scheduler::Job> object as it's only argument.
|
|
59
|
+
|
|
60
|
+
=cut
|
|
61
|
+
|
|
62
|
+
sub on_finish {
|
|
63
|
+
my ( $self, $cb ) = @_;
|
|
64
|
+
$self->{on_finish} = $cb;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
=head3 C<finish>
|
|
68
|
+
|
|
69
|
+
$self->finish;
|
|
70
|
+
|
|
71
|
+
Called when a job is complete to unlock it. If a callback has been registered
|
|
72
|
+
with C<on_finish>, it calls it. Otherwise, it does nothing.
|
|
73
|
+
|
|
74
|
+
=cut
|
|
75
|
+
|
|
76
|
+
sub finish {
|
|
77
|
+
my $self = shift;
|
|
78
|
+
if ( my $cb = $self->{on_finish} ) {
|
|
79
|
+
$cb->($self);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
=head2 Attributes
|
|
84
|
+
|
|
85
|
+
$self->filename;
|
|
86
|
+
$self->description;
|
|
87
|
+
$self->context;
|
|
88
|
+
|
|
89
|
+
These are all "getters" which return the data set for these attributes during object construction.
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
=head3 C<filename>
|
|
93
|
+
|
|
94
|
+
=head3 C<description>
|
|
95
|
+
|
|
96
|
+
=head3 C<context>
|
|
97
|
+
|
|
98
|
+
=cut
|
|
99
|
+
|
|
100
|
+
sub filename { shift->{filename} }
|
|
101
|
+
sub description { shift->{description} }
|
|
102
|
+
sub context { @{ shift->{context} || [] } }
|
|
103
|
+
|
|
104
|
+
=head3 C<as_array_ref>
|
|
105
|
+
|
|
106
|
+
For backwards compatibility in callbacks.
|
|
107
|
+
|
|
108
|
+
=cut
|
|
109
|
+
|
|
110
|
+
sub as_array_ref {
|
|
111
|
+
my $self = shift;
|
|
112
|
+
return [ $self->filename, $self->description, $self->{context} ||= [] ];
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
=head3 C<is_spinner>
|
|
116
|
+
|
|
117
|
+
$self->is_spinner;
|
|
118
|
+
|
|
119
|
+
Returns false indicating that this is a real job rather than a
|
|
120
|
+
'spinner'. Spinners are returned when the scheduler still has pending
|
|
121
|
+
jobs but can't (because of locking) return one right now.
|
|
122
|
+
|
|
123
|
+
=cut
|
|
124
|
+
|
|
125
|
+
sub is_spinner {0}
|
|
126
|
+
|
|
127
|
+
1;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
package TAP::Parser::Scheduler::Spinner;
|
|
2
|
+
|
|
3
|
+
use strict;
|
|
4
|
+
use warnings;
|
|
5
|
+
use Carp;
|
|
6
|
+
|
|
7
|
+
=head1 NAME
|
|
8
|
+
|
|
9
|
+
TAP::Parser::Scheduler::Spinner - A no-op job.
|
|
10
|
+
|
|
11
|
+
=head1 VERSION
|
|
12
|
+
|
|
13
|
+
Version 3.42
|
|
14
|
+
|
|
15
|
+
=cut
|
|
16
|
+
|
|
17
|
+
our $VERSION = '3.42';
|
|
18
|
+
|
|
19
|
+
=head1 SYNOPSIS
|
|
20
|
+
|
|
21
|
+
use TAP::Parser::Scheduler::Spinner;
|
|
22
|
+
|
|
23
|
+
=head1 DESCRIPTION
|
|
24
|
+
|
|
25
|
+
A no-op job. Returned by C<TAP::Parser::Scheduler> as an instruction to
|
|
26
|
+
the harness to spin (keep executing tests) while the scheduler can't
|
|
27
|
+
return a real job.
|
|
28
|
+
|
|
29
|
+
=head1 METHODS
|
|
30
|
+
|
|
31
|
+
=head2 Class Methods
|
|
32
|
+
|
|
33
|
+
=head3 C<new>
|
|
34
|
+
|
|
35
|
+
my $job = TAP::Parser::Scheduler::Spinner->new;
|
|
36
|
+
|
|
37
|
+
Ignores any arguments and returns a new C<TAP::Parser::Scheduler::Spinner> object.
|
|
38
|
+
|
|
39
|
+
=cut
|
|
40
|
+
|
|
41
|
+
sub new { bless {}, shift }
|
|
42
|
+
|
|
43
|
+
=head2 Instance Methods
|
|
44
|
+
|
|
45
|
+
=head3 C<is_spinner>
|
|
46
|
+
|
|
47
|
+
Returns true indicating that is a 'spinner' job. Spinners are returned
|
|
48
|
+
when the scheduler still has pending jobs but can't (because of locking)
|
|
49
|
+
return one right now.
|
|
50
|
+
|
|
51
|
+
=cut
|
|
52
|
+
|
|
53
|
+
sub is_spinner {1}
|
|
54
|
+
|
|
55
|
+
=head1 SEE ALSO
|
|
56
|
+
|
|
57
|
+
L<TAP::Parser::Scheduler>, L<TAP::Parser::Scheduler::Job>
|
|
58
|
+
|
|
59
|
+
=cut
|
|
60
|
+
|
|
61
|
+
1;
|