njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 1 | #! /usr/bin/perl -w |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 2 | ##--------------------------------------------------------------------## |
| 3 | ##--- Valgrind regression testing script vg_regtest ---## |
| 4 | ##--------------------------------------------------------------------## |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 5 | |
njn | c953984 | 2002-10-02 13:26:35 +0000 | [diff] [blame] | 6 | # This file is part of Valgrind, an extensible x86 protected-mode |
| 7 | # emulator for monitoring program execution on x86-Unixes. |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 8 | # |
| 9 | # Copyright (C) 2002 Nicholas Nethercote |
| 10 | # njn25@cam.ac.uk |
| 11 | # |
| 12 | # This program is free software; you can redistribute it and/or |
| 13 | # modify it under the terms of the GNU General Public License as |
| 14 | # published by the Free Software Foundation; either version 2 of the |
| 15 | # License, or (at your option) any later version. |
| 16 | # |
| 17 | # This program is distributed in the hope that it will be useful, but |
| 18 | # WITHOUT ANY WARRANTY; without even the implied warranty of |
| 19 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 20 | # General Public License for more details. |
| 21 | # |
| 22 | # You should have received a copy of the GNU General Public License |
| 23 | # along with this program; if not, write to the Free Software |
| 24 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA |
| 25 | # 02111-1307, USA. |
| 26 | # |
| 27 | # The GNU General Public License is contained in the file COPYING. |
| 28 | |
| 29 | #---------------------------------------------------------------------------- |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 30 | # usage: vg_regtest [options] <dirs | files> |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 31 | # |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 32 | # Options: |
| 33 | # --stable: use stable-branch stderr results (*.stderr.exp.hd) |
| 34 | # --dev: use dev-branch stderr results (*.stderr.exp - default) |
| 35 | # --all: run tests in all subdirs |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 36 | # --valgrind: valgrind to use. Default is one built from this source tree. |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 37 | # |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 38 | # The stable-branch/dev-branch distinction allows slight differences in stderr |
| 39 | # results. |
| 40 | # |
njn | 4ba5a79 | 2002-09-30 10:23:54 +0000 | [diff] [blame] | 41 | # The easiest way is to run all tests in valgrind/ with (assuming you installed |
| 42 | # in $PREFIX): |
| 43 | # |
| 44 | # $PREFIX/bin/vg_regtest --all |
| 45 | # |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 46 | # You can specify individual files to test, or whole directories, or both. |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 47 | # Directories are traversed recursively, except for ones name CVS/ or docs/. |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 48 | # |
| 49 | # Each test is defined in a file <test>.vgtest, containing one or more of the |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 50 | # following lines, in any order: |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 51 | # - prog: <prog to run> (compulsory) |
| 52 | # - args: <args for prog> (default: none) |
| 53 | # - vgopts: <Valgrind options> (default: none) |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 54 | # - vgopts.st: <options, --stable only> (default: none) |
| 55 | # - vgopts.dev: <options, --dev only> (default: none) |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 56 | # - stdout_filter: <filter to run stdout through> (default: none) |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 57 | # - stderr_filter: <filter to run stderr through> (default: ./filter_stderr) |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 58 | # |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 59 | # Note that filters are necessary for stderr results to filter out things that |
| 60 | # always change, eg. process id numbers. |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 61 | # |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 62 | # Expected stdout (filtered) is kept in <test>.stdout.exp. It can be missing |
| 63 | # if it would be empty. |
| 64 | # |
| 65 | # Expected stderr (filtered) is kept in <test>.stderr.exp for --dev, and |
| 66 | # <test>.stderr.exp.hd for --stable (silly ".hd" extension for historical |
| 67 | # reasons). |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 68 | # |
| 69 | # If results don't match, the output can be found in <test>.std<strm>.out, |
| 70 | # and the diff between expected and actual in <test>.std<strm>.diff. |
| 71 | # |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 72 | # Notes on adding regression tests for a new skin are in |
| 73 | # coregrind/docs/skins.html. |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 74 | #---------------------------------------------------------------------------- |
| 75 | |
| 76 | use strict; |
| 77 | |
| 78 | #---------------------------------------------------------------------------- |
| 79 | # Global vars |
| 80 | #---------------------------------------------------------------------------- |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 81 | my $usage="vg_regtest [--stable|--dev, --all, --valgrind]\n"; |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 82 | |
| 83 | my $tmp="vg_regtest.tmp.$$"; |
| 84 | |
| 85 | # Test variables |
| 86 | my $vgopts; # valgrind options |
| 87 | my $prog; # test prog |
| 88 | my $args; # test prog args |
| 89 | my $stdout_filter; # filter program to run stdout results file through |
| 90 | my $stderr_filter; # filter program to run stderr results file through |
| 91 | |
| 92 | my @failures; # List of failed tests |
| 93 | |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 94 | my $exp = ""; # --dev is default |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 95 | |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 96 | # Default valgrind to use is this build tree's one |
| 97 | my $prefix="@prefix@"; |
| 98 | my $exec_prefix="@exec_prefix@"; |
| 99 | my $valgrind = "@bindir@/valgrind"; |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 100 | |
| 101 | chomp(my $tests_dir = `pwd`); |
| 102 | |
| 103 | # default filter is the one named "filter_stderr" in the test's directory |
| 104 | my $default_stderr_filter = "filter_stderr"; |
| 105 | |
| 106 | |
| 107 | #---------------------------------------------------------------------------- |
| 108 | # Process command line, setup |
| 109 | #---------------------------------------------------------------------------- |
| 110 | |
| 111 | # If $prog is a relative path, it prepends $dir to it. Useful for two reasons: |
| 112 | # |
| 113 | # 1. Can prepend "." onto programs to avoid trouble with users who don't have |
| 114 | # "." in their path (by making $dir = ".") |
| 115 | # 2. Can prepend the current dir to make the command absolute to avoid |
| 116 | # subsequent trouble when we change directories. |
| 117 | # |
| 118 | # Also checks the program exists and is executable. |
| 119 | sub validate_program ($$) |
| 120 | { |
| 121 | my ($dir, $prog) = @_; |
| 122 | |
| 123 | # If absolute path, leave it alone. If relative, make it |
| 124 | # absolute -- by prepending current dir -- so we can change |
| 125 | # dirs and still use it. |
| 126 | $prog = "$dir/$prog" if ($prog !~ /^\//); |
| 127 | (-f $prog) or die "`$prog' not found or not a file ($dir)\n"; |
| 128 | (-x $prog) or die "`$prog' not found or not executable ($dir)\n"; |
| 129 | |
| 130 | return $prog; |
| 131 | } |
| 132 | |
| 133 | sub process_command_line() |
| 134 | { |
| 135 | my $alldirs = 0; |
| 136 | my @fs; |
| 137 | |
| 138 | for my $arg (@ARGV) { |
| 139 | if ($arg =~ /^-/) { |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 140 | if ($arg =~ /^--stable$/) { |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 141 | $exp = ".hd"; |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 142 | } elsif ($arg =~ /^--dev$/) { |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 143 | $exp = ""; |
| 144 | } elsif ($arg =~ /^--all$/) { |
| 145 | $alldirs = 1; |
| 146 | } elsif ($arg =~ /^--valgrind=(.*)$/) { |
| 147 | $valgrind = $1; |
| 148 | } else { |
| 149 | die $usage; |
| 150 | } |
| 151 | } else { |
| 152 | push(@fs, $arg); |
| 153 | } |
| 154 | } |
| 155 | $valgrind = validate_program($tests_dir, $valgrind); |
| 156 | |
| 157 | if ($alldirs) { |
| 158 | @fs = (); |
| 159 | foreach my $f (glob "*") { |
| 160 | push(@fs, $f) if (-d $f); |
| 161 | } |
| 162 | } |
| 163 | |
| 164 | (0 != @fs) or die "No test files or directories specified\n"; |
| 165 | |
| 166 | return @fs; |
| 167 | } |
| 168 | |
| 169 | #---------------------------------------------------------------------------- |
| 170 | # Read a .vgtest file |
| 171 | #---------------------------------------------------------------------------- |
| 172 | sub read_vgtest_file($) |
| 173 | { |
| 174 | my ($f) = @_; |
| 175 | |
| 176 | # Defaults. |
| 177 | ($vgopts, $prog, $args, $stdout_filter, $stderr_filter) = |
| 178 | ("", undef, "", undef, undef); |
| 179 | |
| 180 | # Every test directory must have a "filter_stderr" |
| 181 | $stderr_filter = validate_program(".", $default_stderr_filter); |
| 182 | |
| 183 | open(INPUTFILE, "< $f") || die "File $f not openable\n"; |
| 184 | |
| 185 | while (my $line = <INPUTFILE>) { |
| 186 | if ($line =~ /^\s*vgopts:\s*(.*)$/) { |
| 187 | $vgopts = $1; |
| 188 | } elsif ($line =~ /^\s*prog:\s*(.*)$/) { |
| 189 | $prog = validate_program(".", $1); |
| 190 | } elsif ($line =~ /^\s*args:\s*(.*)$/) { |
| 191 | $args = $1; |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 192 | } elsif ($line =~ /^\s*vgopts\.st:\s*(.*)$/) { |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 193 | $vgopts = $1 if ($exp eq ".hd"); |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 194 | } elsif ($line =~ /^\s*vgopts\.dev:\s*(.*)$/) { |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 195 | $vgopts = $1 if ($exp eq ""); |
| 196 | } elsif ($line =~ /^\s*stdout_filter:\s*(.*)$/) { |
| 197 | $stdout_filter = validate_program(".", $1); |
| 198 | } elsif ($line =~ /^\s*stderr_filter:\s*(.*)$/) { |
| 199 | $stderr_filter = validate_program(".", $1); |
| 200 | } else { |
| 201 | die "Bad line in $f: $line\n"; |
| 202 | } |
| 203 | } |
| 204 | close(INPUTFILE); |
| 205 | |
| 206 | if (!defined $prog) { |
| 207 | die "no `prog:' line in `$f'\n"; |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | #---------------------------------------------------------------------------- |
| 212 | # Do one test |
| 213 | #---------------------------------------------------------------------------- |
| 214 | # Since most of the program time is spent in system() calls, need this to |
| 215 | # propagate a Ctrl-C enabling us to quit. |
| 216 | sub mysystem($) |
| 217 | { |
| 218 | (system($_[0]) != 2) or exit 1; # 2 is SIGINT |
| 219 | } |
| 220 | |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 221 | # from a directory name like "/foo/cachesim/tests/" determine the skin name |
| 222 | sub determine_skin() |
| 223 | { |
| 224 | my $dir = `pwd`; |
| 225 | $dir =~ /.*\/([^\/]+)\/tests.*/; # foo/skin_name/tests/foo |
| 226 | return $1; |
| 227 | } |
| 228 | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 229 | sub do_one_test($$) |
| 230 | { |
| 231 | my ($dir, $vgtest) = @_; |
| 232 | $vgtest =~ /^(.*)\.vgtest/; |
| 233 | my $name = $1; |
| 234 | my $fullname = "$dir/$name"; |
| 235 | |
| 236 | read_vgtest_file($vgtest); |
| 237 | |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 238 | printf("%-16s valgrind $vgopts $prog $args\n", "$name:"); |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 239 | |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 240 | # If --dev, pass the appropriate --skin option for the directory (can be |
| 241 | # overridden by an "args:" or "args.dev:" line, though) |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 242 | if ($exp eq ".hd") { |
| 243 | mysystem("$valgrind $vgopts $prog $args > $name.stdout.out 2> $name.stderr.out"); |
| 244 | } else { |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 245 | my $skin=determine_skin(); |
| 246 | mysystem("$valgrind --skin=$skin $vgopts $prog $args > $name.stdout.out 2> $name.stderr.out"); |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 247 | } |
| 248 | |
| 249 | if (defined $stdout_filter) { |
| 250 | mysystem("$stdout_filter < $name.stdout.out > $tmp"); |
| 251 | rename($tmp, "$name.stdout.out"); |
| 252 | } |
| 253 | |
| 254 | mysystem("$stderr_filter < $name.stderr.out > $tmp"); |
| 255 | rename($tmp, "$name.stderr.out"); |
| 256 | |
| 257 | # If stdout expected empty, .exp file might be missing so diff with |
| 258 | # /dev/null |
| 259 | my $stdout_exp = ( -r "$name.stdout.exp" |
| 260 | ? "$name.stdout.exp" |
| 261 | : "/dev/null" ); |
| 262 | |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 263 | # If stable-branch and dev-branch have the same expected stderr output, |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 264 | # foo.stderr.exp.hd might be missing, so use foo.stderr.exp instead if |
njn | a217f3d | 2002-09-27 08:26:27 +0000 | [diff] [blame] | 265 | # --stable is true. |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 266 | my $stderr_exp = "$name.stderr.exp$exp"; |
| 267 | if ($exp eq ".hd" && not -r $stderr_exp) { |
| 268 | $stderr_exp = "$name.stderr.exp"; |
| 269 | } |
| 270 | (-r $stderr_exp) or die "Could not read `$stderr_exp'\n"; |
| 271 | |
| 272 | mysystem("diff -C0 $stdout_exp $name.stdout.out > $name.stdout.diff"); |
| 273 | mysystem("diff -C0 $stderr_exp $name.stderr.out > $name.stderr.diff"); |
| 274 | |
| 275 | for my $ext ("stdout", "stderr") { |
| 276 | if (-s "$name.$ext.diff") { |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 277 | print "*** $name failed ($ext) ***\n"; |
| 278 | push(@failures, sprintf("%-40s $ext", "$fullname")); |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 279 | } else { |
| 280 | unlink("$name.$ext.out", "$name.$ext.diff"); |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | #---------------------------------------------------------------------------- |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 286 | # Test one directory (and any subdirs) |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 287 | #---------------------------------------------------------------------------- |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 288 | sub test_one_dir($$); # forward declaration |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 289 | |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 290 | sub test_one_dir($$) |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 291 | { |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 292 | my ($dir, $prev_dirs) = @_; |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 293 | $dir =~ s/\/$//; # trim a trailing '/' |
| 294 | |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 295 | if ($dir =~ /^(CVS|docs)$/) { return; } # ignore CVS/ and docs/ dirs |
| 296 | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 297 | chdir($dir) or die "Could not change into $dir\n"; |
| 298 | |
njn | 584eaac | 2002-10-04 15:30:48 +0000 | [diff] [blame] | 299 | # Nb: Don't prepend a '/' to the base directory |
| 300 | my $full_dir = $prev_dirs . ($prev_dirs eq "" ? "" : "/") . $dir; |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 301 | my $dashes = "-" x (50 - length $full_dir); |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 302 | |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 303 | my @fs = glob "*"; |
| 304 | my @vgtests = grep { $_ =~ /\.vgtest$/ } @fs; |
| 305 | my $found_tests = (0 != (grep { $_ =~ /\.vgtest$/ } @fs)); |
| 306 | |
| 307 | if ($found_tests) { |
| 308 | print "-- Running tests in $full_dir $dashes\n"; |
| 309 | } else { |
| 310 | print "-- Found no tests in $full_dir $dashes\n"; |
| 311 | } |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 312 | foreach my $f (@fs) { |
| 313 | if (-d $f) { |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 314 | test_one_dir($f, $full_dir); |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 315 | } elsif ($f =~ /\.vgtest$/) { |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 316 | do_one_test($full_dir, $f); |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 317 | } |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 318 | } |
njn | db3c469 | 2002-10-04 10:03:34 +0000 | [diff] [blame] | 319 | if ($found_tests) { |
| 320 | print "-- Finished tests in $full_dir $dashes\n"; |
| 321 | } |
| 322 | |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 323 | chdir(".."); |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 324 | } |
| 325 | |
| 326 | #---------------------------------------------------------------------------- |
| 327 | # Summarise results |
| 328 | #---------------------------------------------------------------------------- |
| 329 | sub summarise_results |
| 330 | { |
njn25 | cac76cb | 2002-09-23 11:21:57 +0000 | [diff] [blame] | 331 | print "\n== Failed tests ===============================\n"; |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 332 | if (0 == @failures) { |
| 333 | print " (none)\n"; |
| 334 | } else { |
| 335 | foreach my $failure (@failures) { |
| 336 | print "$failure\n"; |
| 337 | } |
| 338 | } |
| 339 | } |
| 340 | |
| 341 | #---------------------------------------------------------------------------- |
| 342 | # main(), sort of |
| 343 | #---------------------------------------------------------------------------- |
| 344 | |
| 345 | # undefine $VALGRIND_OPTS |
njn | bf89f31 | 2002-10-30 15:23:05 +0000 | [diff] [blame] | 346 | # (Commented out 2002-Oct-30; was causing "Use of uninitialized value in undef |
| 347 | # operator" warning --njn) |
| 348 | # if ( exists $ENV{VALGRIND_OPTS} ) { |
| 349 | # undef $ENV{VALGRIND_OPTS}; |
| 350 | # } |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 351 | |
| 352 | my @fs = process_command_line(); |
| 353 | foreach my $f (@fs) { |
| 354 | if (-d $f) { |
njn | 584eaac | 2002-10-04 15:30:48 +0000 | [diff] [blame] | 355 | test_one_dir($f, ""); |
njn25 | e49d8e7 | 2002-09-23 09:36:25 +0000 | [diff] [blame] | 356 | } else { |
| 357 | # Allow the .vgtest suffix to be given or omitted |
| 358 | if ($f =~ /.vgtest$/ && -r $f) { |
| 359 | # do nothing |
| 360 | } elsif (-r "$f.vgtest") { |
| 361 | $f = "$f.vgtest"; |
| 362 | } else { |
| 363 | die "`$f' neither a directory nor a readable test file/name\n" |
| 364 | } |
| 365 | my $dir = `dirname $f`; chomp $dir; |
| 366 | my $file = `basename $f`; chomp $file; |
| 367 | chdir($dir) or die "Could not change into $dir\n"; |
| 368 | do_one_test($dir, $file); |
| 369 | chdir($tests_dir); |
| 370 | } |
| 371 | } |
| 372 | summarise_results(); |
| 373 | |
njn | c2e7f48 | 2002-09-27 08:44:17 +0000 | [diff] [blame] | 374 | ##--------------------------------------------------------------------## |
| 375 | ##--- end vg_regtest ---## |
| 376 | ##--------------------------------------------------------------------## |