[PATCH] MM_Unix tests, and some questions
Tels [Sun, 16 Dec 2001 22:29:13 +0000 (23:29 +0100)]
Date: Sun, 16 Dec 2001 22:29:13 +0100 (CET)
Message-Id: <200112162132.XAA12694@tiku.hut.fi>

Subject: Re: [PATCH] MM_Unix tests, and some questions
From: Tels <perl_dummy@bloodgate.com>
Date: Mon, 17 Dec 2001 00:29:11 +0100 (CET)
Message-Id: <200112162332.BAA25411@tiku.hut.fi>

p4raw-id: //depot/perl@13732

MANIFEST
lib/ExtUtils/MM_Unix.pm
lib/ExtUtils/MM_Unix.t [new file with mode: 0644]

index a8ed7fb..c346742 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -944,6 +944,7 @@ lib/ExtUtils/MM_Cygwin.t    See if ExtUtils::MM_Cygwin works
 lib/ExtUtils/MM_NW5.pm         MakeMaker methods for NetWare
 lib/ExtUtils/MM_OS2.pm         MakeMaker methods for OS/2
 lib/ExtUtils/MM_Unix.pm                MakeMaker base class for Unix
+lib/ExtUtils/MM_Unix.t         see if ExtUtils::MM_Unix works
 lib/ExtUtils/MM_VMS.pm         MakeMaker methods for VMS
 lib/ExtUtils/MM_VMS.t          See if ExtUtils::MM_VMS works
 lib/ExtUtils/MM_Win32.pm       MakeMaker methods for Win32
index 2d20314..103854f 100644 (file)
@@ -10,7 +10,7 @@ use strict;
 our ($Is_Mac,$Is_OS2,$Is_VMS,$Is_Win32,$Is_Dos,
            $Verbose,%pm,%static,$Xsubpp_Version);
 
-our $VERSION = '1.12603';
+our $VERSION = '1.12604';
 
 require ExtUtils::MakeMaker;
 ExtUtils::MakeMaker->import(qw($Verbose &neatvalue));
@@ -162,86 +162,84 @@ sub updir {
     return "..";
 }
 
-sub ExtUtils::MM_Unix::c_o ;
-sub ExtUtils::MM_Unix::clean ;
-sub ExtUtils::MM_Unix::const_cccmd ;
-sub ExtUtils::MM_Unix::const_config ;
-sub ExtUtils::MM_Unix::const_loadlibs ;
-sub ExtUtils::MM_Unix::constants ;
-sub ExtUtils::MM_Unix::depend ;
-sub ExtUtils::MM_Unix::dir_target ;
-sub ExtUtils::MM_Unix::dist ;
-sub ExtUtils::MM_Unix::dist_basics ;
-sub ExtUtils::MM_Unix::dist_ci ;
-sub ExtUtils::MM_Unix::dist_core ;
-sub ExtUtils::MM_Unix::dist_dir ;
-sub ExtUtils::MM_Unix::dist_test ;
-sub ExtUtils::MM_Unix::dlsyms ;
-sub ExtUtils::MM_Unix::dynamic ;
-sub ExtUtils::MM_Unix::dynamic_bs ;
-sub ExtUtils::MM_Unix::dynamic_lib ;
-sub ExtUtils::MM_Unix::exescan ;
-sub ExtUtils::MM_Unix::export_list ;
-sub ExtUtils::MM_Unix::extliblist ;
-sub ExtUtils::MM_Unix::file_name_is_absolute ;
-sub ExtUtils::MM_Unix::find_perl ;
-sub ExtUtils::MM_Unix::fixin ;
-sub ExtUtils::MM_Unix::force ;
-sub ExtUtils::MM_Unix::guess_name ;
-sub ExtUtils::MM_Unix::has_link_code ;
-sub ExtUtils::MM_Unix::htmlifypods ;
-sub ExtUtils::MM_Unix::init_dirscan ;
-sub ExtUtils::MM_Unix::init_main ;
-sub ExtUtils::MM_Unix::init_others ;
-sub ExtUtils::MM_Unix::install ;
-sub ExtUtils::MM_Unix::installbin ;
-sub ExtUtils::MM_Unix::libscan ;
-sub ExtUtils::MM_Unix::linkext ;
-sub ExtUtils::MM_Unix::lsdir ;
-sub ExtUtils::MM_Unix::macro ;
-sub ExtUtils::MM_Unix::makeaperl ;
-sub ExtUtils::MM_Unix::makefile ;
-sub ExtUtils::MM_Unix::manifypods ;
-sub ExtUtils::MM_Unix::maybe_command ;
-sub ExtUtils::MM_Unix::maybe_command_in_dirs ;
-sub ExtUtils::MM_Unix::needs_linking ;
-sub ExtUtils::MM_Unix::nicetext ;
-sub ExtUtils::MM_Unix::parse_version ;
-sub ExtUtils::MM_Unix::pasthru ;
-sub ExtUtils::MM_Unix::path ;
-sub ExtUtils::MM_Unix::perl_archive;
-sub ExtUtils::MM_Unix::perl_archive_after;
-sub ExtUtils::MM_Unix::perl_script ;
-sub ExtUtils::MM_Unix::perldepend ;
-sub ExtUtils::MM_Unix::pm_to_blib ;
-sub ExtUtils::MM_Unix::post_constants ;
-sub ExtUtils::MM_Unix::post_initialize ;
-sub ExtUtils::MM_Unix::postamble ;
-sub ExtUtils::MM_Unix::ppd ;
-sub ExtUtils::MM_Unix::prefixify ;
-sub ExtUtils::MM_Unix::processPL ;
-sub ExtUtils::MM_Unix::quote_paren ;
-sub ExtUtils::MM_Unix::realclean ;
-sub ExtUtils::MM_Unix::replace_manpage_separator ;
-sub ExtUtils::MM_Unix::static ;
-sub ExtUtils::MM_Unix::static_lib ;
-sub ExtUtils::MM_Unix::staticmake ;
-sub ExtUtils::MM_Unix::subdir_x ;
-sub ExtUtils::MM_Unix::subdirs ;
-sub ExtUtils::MM_Unix::test ;
-sub ExtUtils::MM_Unix::test_via_harness ;
-sub ExtUtils::MM_Unix::test_via_script ;
-sub ExtUtils::MM_Unix::tool_autosplit ;
-sub ExtUtils::MM_Unix::tool_xsubpp ;
-sub ExtUtils::MM_Unix::tools_other ;
-sub ExtUtils::MM_Unix::top_targets ;
-sub ExtUtils::MM_Unix::writedoc ;
-sub ExtUtils::MM_Unix::xs_c ;
-sub ExtUtils::MM_Unix::xs_cpp ;
-sub ExtUtils::MM_Unix::xs_o ;
-sub ExtUtils::MM_Unix::xsubpp_version ;
-
-package ExtUtils::MM_Unix;
+sub c_o;
+sub clean;
+sub const_cccmd;
+sub const_config;
+sub const_loadlibs;
+sub constants;
+sub depend;
+sub dir_target;
+sub dist;
+sub dist_basics;
+sub dist_ci;
+sub dist_core;
+sub dist_dir;
+sub dist_test;
+sub dlsyms;
+sub dynamic;
+sub dynamic_bs;
+sub dynamic_lib;
+sub exescan;
+sub export_list;
+sub extliblist;
+sub file_name_is_absolute;
+sub find_perl;
+sub fixin;
+sub force;
+sub guess_name;
+sub has_link_code;
+sub htmlifypods;
+sub init_dirscan;
+sub init_main;
+sub init_others;
+sub install;
+sub installbin;
+sub libscan;
+sub linkext;
+sub lsdir;
+sub macro;
+sub makeaperl;
+sub makefile;
+sub manifypods;
+sub maybe_command;
+sub maybe_command_in_dirs;
+sub needs_linking;
+sub nicetext;
+sub parse_version;
+sub pasthru;
+sub path;
+sub perl_archive;
+sub perl_archive_after;
+sub perl_script;
+sub perldepend;
+sub pm_to_blib;
+sub post_constants;
+sub post_initialize;
+sub postamble;
+sub ppd;
+sub prefixify;
+sub processPL;
+sub quote_paren;
+sub realclean;
+sub replace_manpage_separator;
+sub static;
+sub static_lib;
+sub staticmake;
+sub subdir_x;
+sub subdirs;
+sub test;
+sub test_via_harness;
+sub test_via_script;
+sub tool_autosplit;
+sub tool_xsubpp;
+sub tools_other;
+sub top_targets;
+sub writedoc;
+sub xs_c;
+sub xs_cpp;
+sub xs_o;
+sub xsubpp_version;
 
 use SelfLoader;
 
diff --git a/lib/ExtUtils/MM_Unix.t b/lib/ExtUtils/MM_Unix.t
new file mode 100644 (file)
index 0000000..efd047a
--- /dev/null
@@ -0,0 +1,132 @@
+#!./perl -w
+
+# 2001-12-16 Tels first version
+
+BEGIN {
+    chdir 't' if -d 't';
+    @INC = '../lib';
+}
+
+BEGIN { use Test::More; plan tests => 90; }
+
+BEGIN { use_ok( 'ExtUtils::MM_Unix' ); }
+
+use strict;
+use File::Spec;
+
+my $class = 'ExtUtils::MM_Unix';
+
+# only one of the following can be true
+# test should be removed if MM_Unix ever stops handling other OS than Unix
+my $os =  ($ExtUtils::MM_Unix::Is_OS2  || 0)
+       + ($ExtUtils::MM_Unix::Is_Mac   || 0)
+       + ($ExtUtils::MM_Unix::Is_Win32 || 0) 
+       + ($ExtUtils::MM_Unix::Is_Dos   || 0)
+       + ($ExtUtils::MM_Unix::Is_VMS   || 0); 
+ok ( $os <= 1,  'There can be only one (or none)');
+
+is ($ExtUtils::MM_Unix::VERSION, '1.12604', 'Should be that version');
+
+# when the following calls like canonpath, catdir etc are replaced by
+# File::Spec calls, the test's become a bit pointless
+
+foreach ( qw( xx/ ./xx/ xx/././xx xx///xx) )
+  {
+  is ($class->canonpath($_), File::Spec->canonpath($_), "canonpath $_");
+  }
+
+is ($class->catdir('xx','xx'), File::Spec->catdir('xx','xx'),
+     'catdir(xx, xx) => xx/xx');
+is ($class->catfile('xx','xx','yy'), File::Spec->catfile('xx','xx','yy'),
+     'catfile(xx, xx) => xx/xx');
+
+foreach (qw/updir curdir rootdir/)
+  {
+  is ($class->$_(), File::Spec->$_(), $_ );
+  }
+
+foreach ( qw /
+  c_o
+  clean
+  const_cccmd
+  const_config
+  const_loadlibs
+  constants
+  depend
+  dir_target
+  dist
+  dist_basics
+  dist_ci
+  dist_core
+  dist_dir
+  dist_test
+  dlsyms
+  dynamic
+  dynamic_bs
+  dynamic_lib
+  exescan
+  export_list
+  extliblist
+  file_name_is_absolute
+  find_perl
+  fixin
+  force
+  guess_name
+  has_link_code
+  htmlifypods
+  init_dirscan
+  init_main
+  init_others
+  install
+  installbin
+  libscan
+  linkext
+  lsdir
+  macro
+  makeaperl
+  makefile
+  manifypods
+  maybe_command
+  maybe_command_in_dirs
+  needs_linking
+  nicetext
+  parse_version
+  pasthru
+  path
+  perl_archive
+  perl_archive_after
+  perl_script
+  perldepend
+  pm_to_blib
+  post_constants
+  post_initialize
+  postamble
+  ppd
+  prefixify
+  processPL
+  quote_paren
+  realclean
+  replace_manpage_separator
+  static
+  static_lib
+  staticmake
+  subdir_x
+  subdirs
+  test
+  test_via_harness
+  test_via_script
+  tool_autosplit
+  tool_xsubpp
+  tools_other
+  top_targets
+  writedoc
+  xs_c
+  xs_cpp
+  xs_o
+  xsubpp_version 
+  / )
+  {
+  ok ($class->can ($_), "can $_");
+  }
+
+