1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-13 23:10:26 -08:00
emacs/mps/qa/test/script/dirs
Richard Tucker 4f2732f3f2 Add new interface version hu
Copied from Perforce
 Change: 20567
 ServerID: perforce.ravenbrook.com
1999-02-17 17:21:49 +00:00

36 lines
702 B
Perl

#!/usr/local/perl
# $HopeName: MMQA_harness!script:dirs(trunk.3) $
#
# set directories up for testing
# n.b. this must happen _after_ options have been
# parsed, so we know what the value of $PLATFORM is
#
1;
sub set_dirs {
$testlib_dir = $test_dir."/testlib";
$obj_dir = $test_dir."/obj/".$PLATFORM;
&ensuredir($obj_dir);
&ensuredir($LOG_DIR);
}
sub ensuredir {
local ($dir, $tdir, $odir) = @_;
until (-e $dir) {
$tdir = $dir;
$odir = $dir;
until (-e $tdir) {
$odir = $tdir;
unless ($tdir =~ /\/[^\/]*$/) {
die "Failed to create dir: $dir.\n";
}
$tdir =~ s/\/[^\/]*$//; # assume / is separator;
}
mkdir($odir, 0777) || die "Failed to create dir: $dir.\n";
}
}