#!/usr/local/bin/perl # -*-Fundamental-*- # # Copyright (c) 1996 Network Appliance, Inc. # # You may distribute under the terms of the Artistic License, as # specified in the README file included in the ttt distribution. # # $Id: //depot/tools/main/p4bench/runEval#1 $ # A general purpose driver allowing test files consisting of executable # perl code. # # For each test file, evals the contents, inside of a # &ttt{begin,end}_file pair. # sub opts { } sub prereqchk { return 1; } ##### Begin ttt standard preamble - do not change this code! ##### $UNIX = 1; sub dirname { local($dir) = @_; $dir =~ s%^$%.%; $dir = "$dir/"; if ($dir =~ m%^/[^/]*//*$%) { return "/"; } if ($dir =~ m%^.*[^/]//*[^/][^/]*//*$%) { $dir =~ s%^(.*[^/])//*[^/][^/]*//*$%$1%; { return $dir; } } return "."; } $ttt_here = `/bin/pwd`; chop $ttt_here; chdir &dirname($0); $tttroot = `/bin/pwd`; chop $tttroot; chdir $ttt_here; require "$tttroot/tttLib.pl"; ##### End ttt standard preamble - do not change the above code! ##### @paths = @ARGV; @paths = reverse(@paths); &ttt_begin_test; Testfile: while((($file, @paths) = &ttt_nextfile("runEval.*", @paths)), $file) { if (open(FILE, "<$file")) { &ttt_begin_file($file); $slashsave = $/; undef $/; $FILE = ; $/ = $slashsave; eval $FILE; &ttt_end_file; } } &ttt_end_test;