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