7 use lib "$FindBin::Bin";
12 print "Usage: ./setup.pl <cwd> : Setup initial system directories for test\n";
18 my ($cmdfh, $outfh, $cwd, $lastdir) = @_;
19 my $cmd = "CALL mkdir $cwd/$lastdir 0777\n";
22 helper::send_cmd($cmdfh, $outfh, "mkdir", $cmd);
24 # Verify the directory was made correctly
25 helper::verify_cmd($cmdfh, $outfh, "mkdir");
35 if ((@ARGV > 1) && ($ARGV[$currarg++] eq "-alpha")){
37 $alpha_arg = $ARGV[$currarg-1];
40 my $cwd = $ARGV[$currarg];
43 my $testdir = $FindBin::Bin;
47 open2(\*OUTFILE, \*CMDFILE, "$testdir/test_driver --np");
49 open2(\*OUTFILE, \*CMDFILE,
50 "yod -batch -quiet -sz 1 $testdir/test_driver --np");
56 warn "open2 failed: $!\n$@\n";
62 my $outfh = \*OUTFILE;
63 my $cmdfh = \*CMDFILE;
66 helper::send_cmd($cmdfh, $outfh, "init", "CALL init\n");
71 do_makedir($cmdfh, $outfh, $cwd, "tmp_dir");
72 do_makedir($cmdfh, $outfh, $cwd, "tmp_dir/test1");
73 do_makedir($cmdfh, $outfh, $cwd, "tmp_dir/test2");
76 print STDERR "Copying $testdir/helper.pm to $cwd/tmp_dir/test1/helper.pm\n";
77 my $res = `perl $testdir/test_copy.pl $alpha_arg $testdir/helper.pm $cwd/tmp_dir/test1/helper.pm`;
80 if ($res ne "copy test successful") {
81 print STDERR "setup (copy test) failed with message: $res\n";
82 print $cmdfh "exit\n";
85 # Give test_driver time to finish
88 print STDOUT "Copying of helper.pm failed\n";
92 print $cmdfh "exit\n";
95 # Give test_driver time to finish
98 print STDOUT "setup successful\n";