7 use lib "$FindBin::Bin";
12 print "Usage: ./cleanup.pl <cwd> : Remove system directories used for test\n";
18 my ($cmdfh, $outfh, $type, $cwd, $lastdir) = @_;
25 my $cmdstr = "CALL $cmd $cwd/$lastdir\n";
27 # Now remove the file/dir
28 helper::send_cmd($cmdfh, $outfh, $cmd, $cmdstr);
30 # Verify the directory was made correctly
31 helper::verify_cmd($cmdfh, $outfh, $cmd);
41 if ((@ARGV > 1) && ($ARGV[$currarg++] eq "-alpha")){
43 $alpha_arg = $ARGV[$currarg-1];
46 my $cwd = $ARGV[$currarg];
49 my $testdir = $FindBin::Bin;
53 open2(\*OUTFILE, \*CMDFILE, "$testdir/test_driver --np");
55 open2(\*OUTFILE, \*CMDFILE,
56 "yod -batch -quiet -sz 1 $testdir/test_driver --np");
62 warn "open2 failed: $!\n$@\n";
68 my $outfh = \*OUTFILE;
69 my $cmdfh = \*CMDFILE;
72 helper::send_cmd($cmdfh, $outfh, "init", "CALL init\n");
75 # Remove the helper.pms
76 do_remove($cmdfh, $outfh, "file", $cwd, "tmp_dir/helper.pm");
77 do_remove($cmdfh, $outfh, "file", $cwd, "tmp_dir/test1/helper.pm");
80 do_remove($cmdfh, $outfh, "dir", $cwd, "tmp_dir/test1");
81 do_remove($cmdfh, $outfh, "dir", $cwd, "tmp_dir/test2");
82 do_remove($cmdfh, $outfh, "dir", $cwd, "tmp_dir");
84 print $cmdfh "exit\n";
87 # Give test_driver time to finish
90 print STDOUT "cleanup successful\n";