source: vendor/perl/5.8.8/NetWare/t/NWScripts.pl

Last change on this file was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 6.4 KB
Line 
1
2
3print "\nGenerating automated scripts for NetWare...\n\n\n";
4
5
6use File::Basename;
7use File::Copy;
8
9chdir '/perl/scripts/';
10$DirName = "t";
11
12# These scripts have problems (either abend or hang) as of now (11 May 2001).
13# So, they are commented out in the corresponding auto scripts, io.pl and lib.pl
14@ScriptsNotUsed = ("t/io/openpid.t", "t/lib/filehandle.t", "t/lib/memoize/t/expire_module_t.t", "t/lib/NEXT/t/next.t", "t/lib/Math/BigInt/t/require.t", "t/ext/B/t/debug.t", "t/lib/IPC/Open3.t", "t/ext/B/t/showlex.t", "t/op/subst_wamp.t", "t/uni/upper.t", "t/lib/Net/t/ftp.t", "t/op/sort.t", "t/ext/POSIX/t/posix.t", "t/lib/CPAN/t/loadme.t", "t/lib/CPAN/t/vcmp.t");
15
16opendir(DIR, $DirName);
17@Dirs = readdir(DIR);
18close(DIR);
19foreach $DirItem(@Dirs)
20{
21 $DirItem1 = $DirName."/".$DirItem;
22 push @DirNames, $DirItem1; # All items under $DirName folder is copied into an array.
23
24 if(-d $DirItem1)
25 { # If an item is a folder, then open it further.
26
27 # Intemediary automated script like base.pl, lib.pl, cmd.pl etc.
28 $IntAutoScript = "t/".$DirItem.".pl";
29
30 # Open once in write mode since later files are opened in append mode,
31 # and if there already exists a file with the same name, all further opens
32 # will append to that file!!
33 open(FHW, "> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for writing.\n";
34 seek(FHW, 0, 0); # seek to the beginning of the file.
35 close FHW; # close the file.
36 }
37}
38
39
40print "Generating t/nwauto.pl ...\n\n\n";
41
42open(FHWA, "> t/nwauto.pl") or die "Unable to open the file, t/nwauto.pl for writing.\n";
43seek(FHWA, 0, 0); # seek to the beginning of the file.
44
45$version = sprintf("%vd",$^V);
46print FHWA "\n\nprint \"Automated Unit Testing of Perl$version for NetWare\\n\\n\\n\"\;\n\n\n";
47
48
49foreach $FileName(@DirNames)
50{
51 $index = 0;
52 if(-d $FileName)
53 { # If an item is a folder, then open it further.
54
55 $dir = dirname($FileName); # Get the folder name
56
57 foreach $DirItem1(@Dirs)
58 {
59 $DirItem2 = $DirItem1;
60 if($FileName =~ m/$DirItem2/)
61 {
62 $DirItem = $DirItem1;
63
64 # Intemediary automated script like base.pl, lib.pl, cmd.pl etc.
65 $IntAutoScript = "t/".$DirItem.".pl";
66 }
67 }
68
69 # Write into the intermediary auto script.
70 open(FHW, ">> $IntAutoScript") or die "Unable to open the file, $IntAutoScript for appending.\n";
71 seek(FHW, 0, 2); # seek to the end of the file.
72
73 $pos = tell(FHW);
74 if($pos <= 0)