emacs/mps/test/test/script/useful
Gareth Rees e1a70a73db Long delayed maintenance of test suite:
$HopeName$ -> $Id$
space -> arena
mps_arena_create now takes three arguments
/usr/local/perl -> /usr/bin/perl -w
Missing #include <stdio.h> in several tests
Bogus closedir(DIR); in script/clib

Copied from Perforce
 Change: 182199
 ServerID: perforce.ravenbrook.com
2013-05-25 10:33:30 +01:00

54 lines
875 B
Perl

#!/usr/bin/perl -w
# $Id$
# Various subroutines that the MMQA harness finds useful.
#
1;
sub debug {
local ($text) = @_;
if ($DEBUG_INFO eq "on") {
print $text."\n";
}
}
sub mysystem {
local ($command) = @_;
$command = &convdirseps($command);
&debug("SYSTEM >>$command<<");
system($command);
}
sub convdirseps {
local ($a) = @_;
$a =~ s/(\S)\//$1$dirsep/g;
return $a;
}
sub mailfile {
local ($file, $subj) = @_;
if ($MAIL_RESULTS eq "on") {
&$platmailfile($file, $MAIL_TO, $subj);
}
}
#
# comparison of harness version numbers
#
sub vleq {
local ($a, $b, @a, @b) = @_;
@a = split /\./, $a;
@b = split /\./, $b;
while (defined $a[0] && defined $b[0]) {
if ($a[0] == $b[0]) {
shift @a; shift @b;
} else {
return ($a[0] < $b[0]);
}
}
if (! defined $a[0]) { $a[0] = -1 }
if (! defined $b[0]) { $b[0] = -1 }
return ($a[0] <= $b[0]);
}