use Cwd; my($dir) = cwd; $| = 1; use strict; my($sep) = ($^O eq "MSWin32") ? "\\" : "/"; print "1..8\n"; my($i)=1; # Cleanup before we start chdir ("t/PVCSPROJ") && (print "ok $i\n"); $i++; my ($files) = "islvrc.txt pvcsproj.pub exampl* PVCSWORK/src/* archives/src/* nfs map"; if($^O eq "MSWin32"){ $files = "islvrc.txt pvcsproj.pub exampl* PVCSWORK\\src\\*.* archives\\src\\*.* nfsmap"; print `del /S $files`; } else{ $files = "islvrc.txt pvcsproj.pub exampl* PVCSWORK/src/* archives/src/* nfs map"; print `rm -rf $files`; } chdir($dir) && (print "ok $i\n"); $i++; # Create the islvrc.txt file my($islvrc) = $dir.$sep."t/PVCSPROJ".$sep."islvrc.txt"; open(ISLVRC,">$islvrc") && (print "ok $i\n"); print ISLVRC "PVCSPROJ=$dir$sep"."t/PVCSPROJ\n"; print ISLVRC "PVCSPRIV=$dir$sep"."t/PVCSPROJ\n"; print ISLVRC "NFSMAP=$dir$sep"."t/PVCSPROJ\n"; $i++; # Create the pvcsproj.pub file $islvrc = $dir.$sep."t/PVCSPROJ/pvcsproj.pub"; open(ISLVRC,">$islvrc") && (print "ok $i\n"); print ISLVRC "CFG=$dir$sep"."MASTER.CFG\n"; print ISLVRC "DIR=MstrPrjc.prj\n"; print ISLVRC "ARDIR=\n"; print ISLVRC "WKDIR=$dir$sep"."t".$sep."\n"; $i++; # figure out the base dir to emulate nfsmap if running on UNIX if($^O ne "MSWin32"){ my($base); $dir =~ m#^(/[^/]*)#; $base = $1; # Create the nfsmap file $islvrc = $dir.$sep."t/PVCSPROJ/nfsmap"; open(ISLVRC,">$islvrc"); print ISLVRC "N $base\n"; close ISLVRC; } # Create the sample files for testing my @files = qw(foo.c bar.c baz.c blech.h); my($j); foreach $j (@files){ (open(F,">t/PVCSPROJ/PVCSWORK/src/$j")) || (print "not ok $i\n" && die "cant open $j\n"); print "ok $i\n"; print F "foobar\n"; close F; $i++; }