This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add XS::APItest 0.01 from Tim Jenness.
[perl5.git] / ext / XS / APItest / APItest.pm
CommitLineData
3e61d65a
JH
1package XS::APItest;
2
3use 5.008;
4use strict;
5use warnings;
6use Carp;
7
8use base qw/ DynaLoader Exporter /;
9
10# Items to export into callers namespace by default. Note: do not export
11# names by default without a very good reason. Use EXPORT_OK instead.
12# Do not simply export all your public functions/methods/constants.
13
14# Export everything since these functions are only used by a test script
15our @EXPORT = qw( print_double print_nv print_iv print_int
16 print_float print_long_double have_long_double
17 print_uv print_long
18);
19
20our $VERSION = '0.01';
21
22bootstrap XS::APItest $VERSION;
23
241;
25__END__
26
27=head1 NAME
28
29XS::APItest - Test the perl C API
30
31=head1 SYNOPSIS
32
33 use XS::APItest;
34 print_double(4);
35
36=head1 ABSTRACT
37
38This module tests the perl C API. Currently tests that C<printf>
39works correctly.
40
41=head1 DESCRIPTION
42
43This module can be used to check that the perl C API is behaving
44correctly. This module provides test functions and an associated
45test script that verifies the output.
46
47This module is not meant to be installed.
48
49=head2 EXPORT
50
51Exports all the test functions:
52
53=over 4
54
55=item B<print_double>
56
57Test that a double-precision floating point number is formatted
58correctly by C<printf>.
59
60 print_double( $val );
61
62Output is sent to STDOUT.
63
64=item B<print_long_double>
65
66Test that a C<long double> is formatted correctly by
67C<printf>. Takes no arguments - the test value is hard-wired
68into the function (as "7").
69
70 print_long_double();
71
72Output is sent to STDOUT.
73
74=item B<have_long_double>
75
76Determine whether a C<long double> is supported by Perl. This should
77be used to determine whether to test C<print_long_double>.
78
79 print_long_double() if have_long_double;
80
81=item B<print_nv>
82
83Test that an C<NV> is formatted correctly by
84C<printf>.
85
86 print_nv( $val );
87
88Output is sent to STDOUT.
89
90=item B<print_iv>
91
92Test that an C<IV> is formatted correctly by
93C<printf>.
94
95 print_iv( $val );
96
97Output is sent to STDOUT.
98
99=item B<print_uv>
100
101Test that an C<UV> is formatted correctly by
102C<printf>.
103
104 print_uv( $val );
105
106Output is sent to STDOUT.
107
108=item B<print_int>
109
110Test that an C<int> is formatted correctly by
111C<printf>.
112
113 print_int( $val );
114
115Output is sent to STDOUT.
116
117=item B<print_long>
118
119Test that an C<long> is formatted correctly by
120C<printf>.
121
122 print_long( $val );
123
124Output is sent to STDOUT.
125
126=item B<print_float>
127
128Test that a single-precision floating point number is formatted
129correctly by C<printf>.
130
131 print_float( $val );
132
133Output is sent to STDOUT.
134
135=back
136
137=head1 SEE ALSO
138
139L<XS::Typemap>, L<perlapi>.
140
141=head1 AUTHORS
142
143Tim Jenness, E<lt>t.jenness@jach.hawaii.eduE<gt>,
144Christian Soeller, E<lt>csoelle@mph.auckland.ac.nzE<gt>,
145Hugo van der Sanden E<lt>hv@crypt.compulink.co.ukE<gt>
146
147=head1 COPYRIGHT AND LICENSE
148
149Copyright (C) 2002 Tim Jenness, Christian Soeller, Hugo van der Sanden.
150All Rights Reserved.
151
152This library is free software; you can redistribute it and/or modify
153it under the same terms as Perl itself.
154
155=cut