1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-17 00:30:37 -08:00
emacs/mps/qa/test/qa
Richard Tucker 63e0f704aa Bug fix
Copied from Perforce
 Change: 18496
 ServerID: perforce.ravenbrook.com
1997-07-25 09:43:49 +01:00

56 lines
1.5 KiB
Perl

#!/usr/local/bin/perl -w
#
# First, we'll set up @INC so we can find the other
# perl scripts we require. This program will be in the
# test directory, and all the other scripts will be
# in the script subdirectory.
#
# $0 contains the name of this program, as it was run
# this means it may not be the full path, but should be
# enough of the path for us to use it to locate other
# perl scripts.
# We assume the separator is / and the program name is
# made only of A-Za-z0-9 and _.
$test_dir = $0;
$0 = "qa testing"; # this will show up in ps
$test_dir =~ s/\\/\//g; # i.e. convert to unix-style separators
unless ($test_dir =~ m/\//) {
$test_dir = "./".$test_dir;
} # ensure it has at least one / in it
$test_dir =~ s/\/\w+$//; # remove leaf name and preceding separator
$script_dir = $test_dir."/script";
foreach (@INC) {
if ($_ ne '.') { push(@newINC, $_) }
}
push(@newINC, $script_dir);
@INC = @newINC;
# other directories will be set when needed by requiring
# the 'dirs' file. This must be done after reading command-line
# options, so we don't try it now
# Now we must process the command-line to qa
# Since options may be command-dependent, all we do now
# is get the command and run it
$qa_command = shift(@ARGV);
unless ($qa_command) {
die "You must specify a command -- try 'qa help' for details.\n";
}
unless (-e "$script_dir/commands/".$qa_command) {
die "Unknown command '".$qa_command."' -- 'qa help' for info.\n";
}
require "optproc";
do "commands/".$qa_command;
if ($@) {print $@};