1 $! Test.Com - DCL driver for perl5 regression tests
3 $! Version 1.1 4-Dec-1995
4 $! Charles Bailey bailey@newman.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 /NoFacility/NoSeverity/NoIdentification/NoText
25 $ If p1.nes."" Then exe = p1
26 $ If F$Extract(0,1,exe) .nes. "."
29 $ Write Sys$Error "The first parameter passed to Test.Com must be the file type used for the"
30 $ Write Sys$Error "images produced when you built Perl (i.e. "".Exe"", unless you edited"
31 $ Write Sys$Error "Descrip.MMS or used the AXE=1 macro in the MM[SK] command line."
36 $! "debug" perl if second parameter is nonblank
40 $ if p2.nes."" then dbg = "dbg"
41 $ if p2.nes."" then ndbg = "ndbg"
43 $! Pick up a copy of perl to use for the tests
44 $ If F$Search("Perl.").nes."" Then Delete/Log/NoConfirm Perl.;*
45 $ Copy/Log/NoConfirm [-]'ndbg'Perl'exe' []Perl.
47 $! Pick up a copy of vmspipe.com to use for the tests
48 $ If F$Search("VMSPIPE.COM").nes."" then Delete/Log/Noconfirm VMSPIPE.COM;*
49 $ Copy/Log/NoConfirm [-]VMSPIPE.COM []
51 $! Make the environment look a little friendlier to tests which assume Unix
53 $ Macro/NoDebug/NoList/Object=Echo.Obj Sys$Input
58 .byte 14 ; DSC$K_DTYPE_T
59 .byte 2 ; DSC$K_CLASS_D
65 calls #1,G^LIB$GET_FOREIGN
89 calls #1,G^LIB$PUT_OUTPUT
93 $ If F$Search("Echo.Exe").nes."" Then Delete/Log/NoConfirm Echo.Exe;*
94 $ Link/NoMap/NoTrace/Exe=Echo.Exe Echo.Obj;
95 $ Delete/Log/NoConfirm Echo.Obj;*
96 $ echo == "$" + F$Parse("Echo.Exe")
99 $ Show Process/Accounting
100 $ testdir = "Directory/NoHead/NoTrail/Column=1"
101 $ oldshr = F$TrnLNm("''dbg'PerlShr","LNM$PROCESS")
102 $ If F$Length(oldshr).ne.0 Then Write Sys$Error "Superseding ''dbg'PerlShr . . ."
103 $ Define 'dbg'Perlshr Sys$Disk:[-]'dbg'PerlShr'exe'
104 $ MCR Sys$Disk:[]Perl. "-I[-.lib]" - "''p3'" "''p4'" "''p5'" "''p6'"
105 $ Deck/Dollar=$$END-OF-TEST$$
106 # $RCSfile: TEST,v $$Revision: 4.1 $$Date: 92/08/07 18:27:00 $
107 # Modified for VMS 30-Sep-1994 Charles Bailey bailey@newman.upenn.edu
109 # This is written in a peculiar style, since we're trying to avoid
110 # most of the constructs we'll be testing for.
112 # skip those tests we know will fail entirely or cause perl to hang bacause
113 # of Unixisms in the tests. (The Perl operators being tested may work fine,
114 # but the tests may use other operators which don't.)
118 @ioexcl=('argv.t','dup.t','fs.t','pipe.t');
119 @libexcl=('db-btree.t','db-hash.t','db-recno.t',
120 'gdbm.t','io_dup.t', 'io_pipe.t', 'io_poll.t', 'io_sel.t',
121 'io_sock.t', 'io_unix.t',
122 'ndbm.t','odbm.t','open2.t','open3.t', 'ph.t', 'posix.t');
124 # Note: POSIX is not part of basic build, but can be built
125 # separately if you're using DECC
126 # io_xs.t tests the new_tmpfile routine, which doesn't work with the
127 # VAXCRTL, since the file can't be stat()d, an Perl's do_open()
128 # insists on stat()ing a file descriptor before it'll use it.
129 push(@libexcl,'io_xs.t') if $Config{'vms_cc_type'} ne 'decc';
131 @opexcl=('die_exit.t','exec.t','fork.t','glob.t','groups.t','magic.t','misc.t','stat.t');
132 @exclist=(@compexcl,@ioexcl,@libexcl,@opexcl);
133 foreach $file (@exclist) { $skip{$file}++; }
137 @ARGV = grep($_,@ARGV); # remove empty elements due to "''p1'" syntax
139 if (lc($ARGV[0]) eq '-v') {
144 chdir 't' if -f 't/TEST';
146 if ($ARGV[0] eq '') {
147 foreach (<[.*]*.t>) {
149 ($fname = $_) =~ s/.*\]//;
150 if ($skip{"\L$fname"}) { push(@skipped,$_); }
151 else { push(@ARGV,$_); }
156 print "The following tests were skipped because they rely extensively on\n";
157 print " Unixisms not compatible with the current version of perl for VMS:\n";
158 print "\t",join("\n\t",@skipped),"\n\n";
164 while ($test = shift) {
170 $te .= '.' x (24 - length($te));
171 open(script,"$test") || die "Can't run $test.\n";
174 if (/#!..perl(.*)/) {
176 # Add "" to protect uppercase switches on command line
177 $switch =~ s/-(\S*[A-Z]\S*)/"-$1"/g;
181 open(results,"\$ MCR Sys\$Disk:[]Perl. \"-I[-.lib]\" $switch $test 2>&1|") || (print "can't run.\n");
191 if (/^1\.\.([0-9]+)/) {
198 $next = $1, $ok = 0, last if /^not ok ([0-9]*)/;
199 next if /^\s*$/; # our 'echo' substitute produces one more \n than Unix'
200 if (/^ok (.*)/ && $1 == $next) {
201 $next = $1, $ok=0, last if $pending_not;
212 if ($ok && $next == $max) {
217 print "${te}skipping test on this platform\n";
222 print "${te}FAILED on test $next\n";
226 die "Failed a basic test--cannot continue.\n";
233 print "All tests successful.\n";
235 die "FAILED--no tests were run for some reason.\n";
238 $pct = sprintf("%.2f", $good / $total * 100);
240 warn "Failed 1 test, $pct% okay.\n";
242 warn "Failed $bad/$total tests, $pct% okay.\n";
245 ($user,$sys,$cuser,$csys) = times;
246 print sprintf("u=%g s=%g cu=%g cs=%g scripts=%d tests=%d\n",
247 $user,$sys,$cuser,$csys,$files,$totmax);
250 $ If F$Length(oldshr).ne.0
252 $ Write Sys$Error "restoring ''dbg'PerlShr . . ."
253 $ Def/Translation=Concealed 'dbg'PerlShr 'oldshr'
255 $ Deassign 'dbg'PerlShr
257 $ Show Process/Accounting
258 $ Set Default &olddef
259 $ Set Message 'oldmsg'