This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Re-applying #13752 until a better solution can be found.
[perl5.git] / lib / ExtUtils / t / MM_Unix.t
... / ...
CommitLineData
1#!./perl -w
2
3# 2001-12-16 Tels first version
4
5BEGIN {
6 chdir 't' if -d 't';
7 @INC = '../lib';
8}
9
10BEGIN {
11 use Test::More;
12
13 if( $^O =~ /^VMS|os2|MacOS|MSWin32|cygwin$/ ) {
14 plan skip_all => 'Non-Unix platform';
15 }
16 else {
17 plan tests => 90;
18 }
19}
20
21BEGIN { use_ok( 'ExtUtils::MM_Unix' ); }
22
23use strict;
24use File::Spec;
25
26my $class = 'ExtUtils::MM_Unix';
27
28# only one of the following can be true
29# test should be removed if MM_Unix ever stops handling other OS than Unix
30my $os = ($ExtUtils::MM_Unix::Is_OS2 || 0)
31 + ($ExtUtils::MM_Unix::Is_Mac || 0)
32 + ($ExtUtils::MM_Unix::Is_Win32 || 0)
33 + ($ExtUtils::MM_Unix::Is_Dos || 0)
34 + ($ExtUtils::MM_Unix::Is_VMS || 0);
35ok ( $os <= 1, 'There can be only one (or none)');
36
37is ($ExtUtils::MM_Unix::VERSION, '1.12604', 'Should be that version');
38
39# when the following calls like canonpath, catdir etc are replaced by
40# File::Spec calls, the test's become a bit pointless
41
42foreach ( qw( xx/ ./xx/ xx/././xx xx///xx) )
43 {
44 is ($class->canonpath($_), File::Spec->canonpath($_), "canonpath $_");
45 }
46
47is ($class->catdir('xx','xx'), File::Spec->catdir('xx','xx'),
48 'catdir(xx, xx) => xx/xx');
49is ($class->catfile('xx','xx','yy'), File::Spec->catfile('xx','xx','yy'),
50 'catfile(xx, xx) => xx/xx');
51
52foreach (qw/updir curdir rootdir/)
53 {
54 is ($class->$_(), File::Spec->$_(), $_ );
55 }
56
57foreach ( qw /
58 c_o
59 clean
60 const_cccmd
61 const_config
62 const_loadlibs
63 constants
64 depend
65 dir_target
66 dist
67 dist_basics
68 dist_ci
69 dist_core
70 dist_dir
71 dist_test
72 dlsyms
73 dynamic
74 dynamic_bs
75 dynamic_lib
76 exescan
77 export_list
78 extliblist
79 file_name_is_absolute
80 find_perl
81 fixin
82 force
83 guess_name
84 has_link_code
85 htmlifypods
86 init_dirscan
87 init_main
88 init_others
89 install
90 installbin
91 libscan
92 linkext
93 lsdir
94 macro
95 makeaperl
96 makefile
97 manifypods
98 maybe_command
99 maybe_command_in_dirs
100 needs_linking
101 nicetext
102 parse_version
103 pasthru
104 path
105 perl_archive
106 perl_archive_after
107 perl_script
108 perldepend
109 pm_to_blib
110 post_constants
111 post_initialize
112 postamble
113 ppd
114 prefixify
115 processPL
116 quote_paren
117 realclean
118 replace_manpage_separator
119 static
120 static_lib
121 staticmake
122 subdir_x
123 subdirs
124 test
125 test_via_harness
126 test_via_script
127 tool_autosplit
128 tool_xsubpp
129 tools_other
130 top_targets
131 writedoc
132 xs_c
133 xs_cpp
134 xs_o
135 xsubpp_version
136 / )
137 {
138 ok ($class->can ($_), "can $_");
139 }
140
141