1 $! Test.Com - DCL driver for perl5 regression tests
3 $! Version 1.1 4-Dec-1995
4 $! Charles Bailey bailey@genetics.upenn.edu
6 $! A little basic setup
7 $ On Error Then Goto wrapup
8 $ olddef = F$Environment("Default")
9 $ oldmsg = F$Environment("Message")
10 $ If F$Search("t.dir").nes.""
14 $ If F$TrnLNm("Perl_Root").nes.""
16 $ Set Default Perl_Root:[t]
18 $ Write Sys$Error "Can't find test directory"
22 $ Set Message /Facility/Severity/Identification/Text
25 $ If p1.nes."" Then exe = p1
26 $! Pick up a copy of perl to use for the tests
27 $ Delete/Log/NoConfirm Perl.;*
28 $ Copy/Log/NoConfirm [-]Perl'exe' []Perl.
30 $! Make the environment look a little friendlier to tests which assume Unix
32 $ Macro/NoDebug/NoList/Object=Echo.Obj Sys$Input
37 .byte 14 ; DSC$K_DTYPE_T
38 .byte 2 ; DSC$K_CLASS_D
44 calls #1,G^LIB$GET_FOREIGN
68 calls #1,G^LIB$PUT_OUTPUT
72 $ Link/NoMap/NoTrace/Exe=Echo.Exe Echo.Obj;
73 $ Delete/Log/NoConfirm Echo.Obj;*
74 $ echo = "$" + F$Parse("Echo.Exe")
77 $ Show Process/Accounting
78 $ testdir = "Directory/NoHead/NoTrail/Column=1"
79 $ Define/User Perlshr Sys$Disk:[-]PerlShr'exe'
80 $ MCR Sys$Disk:[]Perl. "-I[-.lib]" - "''p2'" "''p3'" "''p4'" "''p5'" "''p6'"
81 $ Deck/Dollar=$$END-OF-TEST$$
82 # $RCSfile: TEST,v $$Revision: 4.1 $$Date: 92/08/07 18:27:00 $
83 # Modified for VMS 30-Sep-1994 Charles Bailey bailey@genetics.upenn.edu
85 # This is written in a peculiar style, since we're trying to avoid
86 # most of the constructs we'll be testing for.
88 # skip those tests we know will fail entirely or cause perl to hang bacause
89 # of Unixisms in the tests. (The Perl operators being tested may work fine,
90 # but the tests may use other operators which don't.)
94 @ioexcl=('argv.t','dup.t','fs.t','inplace.t','pipe.t');
95 @libexcl=('db-btree.t','db-hash.t','db-recno.t',
96 'gdbm.t','io_dup.t', 'io_pipe.t', 'io_sel.t', 'io_sock.t',
97 'ndbm.t','odbm.t','open2.t','open3.t', 'ph.t', 'posix.t');
99 # Note: POSIX is not part of basic build, but can be built
100 # separately if you're using DECC
101 # io_xs.t tests the new_tmpfile routine, which doesn't work with the
102 # VAXCRTL, since the file can't be stat()d, an Perl's do_open()
103 # insists on stat()ing a file descriptor before it'll use it.
104 push(@libexcl,'io_xs.t') if $Config{'vms_cc_type'} ne 'decc';
106 @opexcl=('exec.t','fork.t','glob.t','groups.t','magic.t','misc.t','stat.t');
107 @exclist=(@compexcl,@ioexcl,@libexcl,@opexcl);
108 foreach $file (@exclist) { $skip{$file}++; }
112 @ARGV = grep($_,@ARGV); # remove empty elements due to "''p1'" syntax
114 if (lc($ARGV[0]) eq '-v') {
119 chdir 't' if -f 't/TEST';
121 if ($ARGV[0] eq '') {
122 foreach (<[.*]*.t>) {
124 ($fname = $_) =~ s/.*\]//;
125 if ($skip{"\L$fname"}) { push(@skipped,$_); }
126 else { push(@ARGV,$_); }
131 print "The following tests were skipped because they rely extensively on\n";
132 print " Unixisms not compatible with the current version of perl for VMS:\n";
133 print "\t",join("\n\t",@skipped),"\n\n";
139 while ($test = shift) {
145 $te .= '.' x (24 - length($te));
146 open(script,"$test") || die "Can't run $test.\n";
149 if (/#!..perl(.*)/) {
151 # Add "" to protect uppercase switches on command line
152 $switch =~ s/-(\S*[A-Z]\S*)/"-$1"/g;
156 open(results,"\$ MCR Sys\$Disk:[]Perl. $switch $test |") || (print "can't run.\n");
165 if (/^1\.\.([0-9]+)/) {
172 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
173 next if /^\s*$/; # our 'echo' substitute produces one more \n than Unix'
174 if (/^ok (.*)/ && $1 == $next) {
183 if ($ok && $next == $max) {
188 print "${te}skipping test on this platform\n";
193 print "${te}FAILED on test $next\n";
197 die "Failed a basic test--cannot continue.\n";
204 print "All tests successful.\n";
206 die "FAILED--no tests were run for some reason.\n";
209 $pct = sprintf("%.2f", $good / $total * 100);
211 warn "Failed 1 test, $pct% okay.\n";
213 warn "Failed $bad/$total tests, $pct% okay.\n";
216 ($user,$sys,$cuser,$csys) = times;
217 print sprintf("u=%g s=%g cu=%g cs=%g files=%d tests=%d\n",
218 $user,$sys,$cuser,$csys,$files,$totmax);
221 $ Show Process/Accounting
222 $ If F$Search("Echo.Exe").nes."" Then Delete/Log/NoConfirm Echo.Exe;*
223 $ Set Default &olddef
224 $ Set Message 'oldmsg'