Commit | Line | Data |
a0d0e21e |
1 | $! Test.Com - DCL driver for perl5 regression tests |
2 | $! |
e518068a |
3 | $! Version 1.1 4-Dec-1995 |
a0d0e21e |
4 | $! Charles Bailey bailey@genetics.upenn.edu |
5 | $ |
6 | $! A little basic setup |
7 | $ On Error Then Goto wrapup |
e518068a |
8 | $ olddef = F$Environment("Default") |
9 | $ If F$Search("t.dir").nes."" |
10 | $ Then |
11 | $ Set Default [.t] |
12 | $ Else |
13 | $ If F$TrnLNm("Perl_Root").nes."" |
14 | $ Then |
15 | $ Set Default Perl_Root:[t] |
16 | $ Else |
17 | $ Write Sys$Error "Can't find test directory" |
18 | $ Exit 44 |
19 | $ EndIf |
20 | $ EndIf |
a0d0e21e |
21 | $ |
271404a7 |
22 | $ exe = ".Exe" |
23 | $ If p1.nes."" Then exe = p1 |
a0d0e21e |
24 | $! Pick up a copy of perl to use for the tests |
25 | $ Delete/Log/NoConfirm Perl.;* |
271404a7 |
26 | $ Copy/Log/NoConfirm [-]Perl'exe' []Perl. |
a0d0e21e |
27 | $ |
28 | $! Make the environment look a little friendlier to tests which assume Unix |
29 | $ cat = "Type" |
30 | $ Macro/NoDebug/Object=Echo.Obj Sys$Input |
31 | .title echo |
32 | .psect data,wrt,noexe |
33 | dsc: |
34 | .word 0 |
35 | .byte 14 ; DSC$K_DTYPE_T |
36 | .byte 2 ; DSC$K_CLASS_D |
37 | .long 0 |
38 | .psect code,nowrt,exe |
39 | .entry echo,^m<r2,r3> |
40 | movab dsc,r2 |
41 | pushab (r2) |
42 | calls #1,G^LIB$GET_FOREIGN |
43 | movl 4(r2),r3 |
44 | movzwl (r2),r0 |
45 | addl2 4(r2),r0 |
46 | cmpl r3,r0 |
47 | bgtru sym.3 |
48 | nop |
49 | sym.1: |
50 | movb (r3),r0 |
51 | cmpb r0,#65 |
52 | blss sym.2 |
53 | cmpb r0,#90 |
54 | bgtr sym.2 |
55 | cvtbl r0,r0 |
56 | addl2 #32,r0 |
57 | cvtlb r0,(r3) |
58 | sym.2: |
59 | incl r3 |
60 | movzwl (r2),r0 |
61 | addl2 4(r2),r0 |
62 | cmpl r3,r0 |
63 | blequ sym.1 |
64 | sym.3: |
65 | pushab (r2) |
66 | calls #1,G^LIB$PUT_OUTPUT |
67 | movl #1,r0 |
68 | ret |
69 | .end echo |
271404a7 |
70 | $ Link/NoTrace/Exe=Echo.Exe Echo.Obj; |
a0d0e21e |
71 | $ Delete/Log/NoConfirm Echo.Obj;* |
748a9306 |
72 | $ echo = "$" + F$Parse("Echo.Exe") |
a0d0e21e |
73 | $ |
74 | $! And do it |
e518068a |
75 | $ testdir = "Directory/NoHead/NoTrail/Column=1" |
271404a7 |
76 | $ Define/User Perlshr Sys$Disk:[-]PerlShr'exe' |
77 | $ MCR Sys$Disk:[]Perl. "''p2'" "''p3'" "''p4'" "''p5'" "''p6'" |
a0d0e21e |
78 | $ Deck/Dollar=$$END-OF-TEST$$ |
79 | # $RCSfile: TEST,v $$Revision: 4.1 $$Date: 92/08/07 18:27:00 $ |
80 | # Modified for VMS 30-Sep-1994 Charles Bailey bailey@genetics.upenn.edu |
81 | # |
82 | # This is written in a peculiar style, since we're trying to avoid |
83 | # most of the constructs we'll be testing for. |
84 | |
85 | # skip those tests we know will fail entirely or cause perl to hang bacause |
271404a7 |
86 | # of Unixisms in the tests. (The Perl operators being tested may work fine, |
87 | # but the tests may use other operators which don't.) |
a0d0e21e |
88 | @compexcl=('cpp.t','script.t'); |
89 | @ioexcl=('argv.t','dup.t','fs.t','inplace.t','pipe.t'); |
90 | @libexcl=('anydbm.t','db-btree.t','db-hash.t','db-recno.t', |
271404a7 |
91 | 'gdbm.t','io_dup.t', 'io_pipe.t', 'io_sock.t', |
92 | 'ndbm.t','odbm.t','posix.t','sdbm.t','soundex.t'); |
93 | # Note: POSIX is not part of basic build, but can be built |
94 | # separately if you're using DECC |
95 | @opexcl=('exec.t','fork.t','glob.t','groups.t','magic.t','misc.t','stat.t'); |
a0d0e21e |
96 | @exclist=(@compexcl,@ioexcl,@libexcl,@opexcl); |
97 | foreach $file (@exclist) { $skip{$file}++; } |
98 | |
99 | $| = 1; |
100 | |
34b5aed4 |
101 | @ARGV = grep($_,@ARGV); # remove empty elements due to "''p1'" syntax |
102 | |
103 | if ($ARGV[0] eq '-v') { |
a0d0e21e |
104 | $verbose = 1; |
34b5aed4 |
105 | shift; |
106 | } |
a0d0e21e |
107 | |
108 | chdir 't' if -f 't/TEST'; |
109 | |
110 | if ($ARGV[0] eq '') { |
34b5aed4 |
111 | foreach (<[.*]*.t>) { |
112 | s/.*[\[.]t./[./; |
113 | ($fname = $_) =~ s/.*\]//; |
a0d0e21e |
114 | if ($skip{"\L$fname"}) { push(@skipped,$_); } |
115 | else { push(@ARGV,$_); } |
116 | } |
117 | } |
118 | |
119 | if (@skipped) { |
120 | print "The following tests were skipped because they rely extensively on\n"; |
121 | print " Unixisms not compatible with the current version of perl for VMS:\n"; |
34b5aed4 |
122 | print "\t",join("\n\t",@skipped),"\n\n"; |
a0d0e21e |
123 | } |
124 | |
125 | $bad = 0; |
126 | $good = 0; |
127 | $total = @ARGV; |
128 | while ($test = shift) { |
129 | if ($test =~ /^$/) { |
130 | next; |
131 | } |
132 | $te = $test; |
133 | chop($te); |
34b5aed4 |
134 | $te .= '.' x (24 - length($te)); |
a0d0e21e |
135 | open(script,"$test") || die "Can't run $test.\n"; |
136 | $_ = <script>; |
137 | close(script); |
138 | if (/#!..perl(.*)/) { |
139 | $switch = $1; |
55497cff |
140 | # Add "" to protect uppercase switches on command line |
141 | $switch =~ s/-([A-Z]\S*)/"-$1"/g; |
a0d0e21e |
142 | } else { |
143 | $switch = ''; |
144 | } |
145 | open(results,"\$ MCR Sys\$Disk:[]Perl. $switch $test |") || (print "can't run.\n"); |
146 | $ok = 0; |
147 | $next = 0; |
148 | while (<results>) { |
149 | if ($verbose) { |
34b5aed4 |
150 | print "$te$_"; |
151 | $te = ''; |
a0d0e21e |
152 | } |
153 | unless (/^#/) { |
154 | if (/^1\.\.([0-9]+)/) { |
155 | $max = $1; |
156 | $totmax += $max; |
157 | $files += 1; |
158 | $next = 1; |
159 | $ok = 1; |
160 | } else { |
161 | $next = $1, $ok = 0, last if /^not ok ([0-9]*)/; |
162 | next if /^\s*$/; # our 'echo' substitute produces one more \n than Unix' |
163 | if (/^ok (.*)/ && $1 == $next) { |
164 | $next = $next + 1; |
165 | } else { |
166 | $ok = 0; |
167 | } |
168 | } |
169 | } |
170 | } |
171 | $next = $next - 1; |
172 | if ($ok && $next == $max) { |
271404a7 |
173 | if ($max) { |
174 | print "${te}ok\n"; |
175 | $good = $good + 1; |
176 | } else { |
177 | print "${te}skipping test on this platform\n"; |
178 | $files -= 1; |
179 | } |
a0d0e21e |
180 | } else { |
181 | $next += 1; |
34b5aed4 |
182 | print "${te}FAILED on test $next\n"; |
a0d0e21e |
183 | $bad = $bad + 1; |
184 | $_ = $test; |
185 | if (/^base/) { |
186 | die "Failed a basic test--cannot continue.\n"; |
187 | } |
188 | } |
189 | } |
190 | |
191 | if ($bad == 0) { |
192 | if ($ok) { |
193 | print "All tests successful.\n"; |
194 | } else { |
195 | die "FAILED--no tests were run for some reason.\n"; |
196 | } |
197 | } else { |
198 | $pct = sprintf("%.2f", $good / $total * 100); |
199 | if ($bad == 1) { |
200 | warn "Failed 1 test, $pct% okay.\n"; |
201 | } else { |
202 | warn "Failed $bad/$total tests, $pct% okay.\n"; |
203 | } |
204 | } |
205 | ($user,$sys,$cuser,$csys) = times; |
206 | print sprintf("u=%g s=%g cu=%g cs=%g files=%d tests=%d\n", |
207 | $user,$sys,$cuser,$csys,$files,$totmax); |
208 | $$END-OF-TEST$$ |
209 | $ wrapup: |
210 | $ If F$Search("Echo.Exe").nes."" Then Delete/Log/NoConfirm Echo.Exe;* |
e518068a |
211 | $ Set Default &olddef |
a0d0e21e |
212 | $ Exit |