This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
add Perl_current_re_engine() function
[perl5.git] / t / lib / 1_compile.t
index 18b0d05..a4dea83 100644 (file)
@@ -11,12 +11,22 @@ BEGIN {
 
 use strict;
 use warnings;
+use File::Spec::Functions;
 
 # Okay, this is the list.
 
-my @Core_Modules = grep /\S/, sort <DATA>;
+my @Core_Modules = grep /\S/, <DATA>;
 chomp @Core_Modules;
 
+if (eval { require Socket }) {
+  # Two Net:: modules need the Convert::EBCDIC if in EBDCIC.
+  if (ord("A") != 193 || eval { require Convert::EBCDIC }) {
+      push @Core_Modules, qw(Net::Cmd Net::POP3);
+  }
+}
+
+@Core_Modules = sort @Core_Modules;
+
 print "1..".(1+@Core_Modules)."\n";
 
 my $message
@@ -26,12 +36,18 @@ if (@Core_Modules) {
 } else {
   print $message;
 }
+print <<'EOREWARD';
+# http://www.xray.mpe.mpg.de/mailing-lists/perl5-porters/2001-04/msg01223.html
+# 20010421230349.P2946@blackrider.blackstar.co.uk
+EOREWARD
 
 my $test_num = 2;
 
 foreach my $module (@Core_Modules) {
-    print "$module compile failed\nnot " unless compile_module($module);
-    print "ok $test_num\n";
+    my $todo = '';
+    $todo = "# TODO $module needs porting on $^O" if $module eq 'ByteLoader' && $^O eq 'VMS';
+    print "# $module compile failed\nnot " unless compile_module($module);
+    print "ok $test_num $todo\n";
     $test_num++;
 }
 
@@ -40,30 +56,16 @@ foreach my $module (@Core_Modules) {
 sub compile_module {
     my ($module) = $_[0];
 
-    my $out = scalar `$^X "-I../lib" lib/compmod.pl $module`;
+    my $compmod = catfile(curdir(), 'lib', 'compmod.pl');
+    my $lib     = '-I' . catdir(updir(), 'lib');
+
+    my $out = scalar `$^X $lib $compmod $module`;
     print "# $out";
     return $out =~ /^ok/;
 }
 
 # These modules have no tests of their own.
 # Keep up to date with
-# http://www.pobox.com/~schwern/cgi-bin/perl-qa-wiki.cgi?UntestedModules
+# http://perl-qa.hexten.net/wiki/index.php/Untested_Core_Modules
 # and vice-versa.  The list should only shrink.
 __DATA__
-B::CC
-B::Disassembler
-B::Stackobj
-ByteLoader
-CPAN
-CPAN::FirstTime
-DynaLoader
-ExtUtils::MM_NW5
-ExtUtils::Install
-ExtUtils::Liblist
-ExtUtils::Mksymlists
-Net::Cmd
-Net::Domain
-Net::POP3
-O
-Pod::Plainer
-Test::Harness::Iterator