mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-03-30 02:33:03 -07:00
Mend option processing
Copied from Perforce Change: 18182 ServerID: perforce.ravenbrook.com
This commit is contained in:
parent
13924590d9
commit
bb63ec232a
5 changed files with 40 additions and 58 deletions
|
|
@ -16,19 +16,12 @@ $test_dir = $0;
|
|||
|
||||
$0 = "qa testing"; # this will show up in ps
|
||||
|
||||
$test_dir =~ s/\/\w+$//;
|
||||
|
||||
$script_dir = $test_dir."/script";
|
||||
$testlib_dir = $test_dir."/testlib"; &use($testlib_dir);
|
||||
|
||||
$platform_class = `class`;
|
||||
chop($platform_class);
|
||||
$obj_dir = $test_dir."/obj/".$platform_class;
|
||||
unless (-e $obj_dir) {
|
||||
mkdir($obj_dir,0777)
|
||||
|| die "Couldn't find or create obj dir: $obj_dir.";
|
||||
if ($test_dir eq "qa") {
|
||||
$test_dir = "./qa"
|
||||
}
|
||||
$report_dir = $test_dir."/report"; &use($report_dir);
|
||||
|
||||
$test_dir =~ s/\/\w+$//;
|
||||
$script_dir = $test_dir."/script";
|
||||
|
||||
foreach (@INC) {
|
||||
if ($_ ne '.') { push(@newINC, $_) }
|
||||
|
|
@ -36,55 +29,25 @@ foreach (@INC) {
|
|||
push(@newINC, $script_dir);
|
||||
@INC = @newINC;
|
||||
|
||||
# Now we must process the command-line arguments
|
||||
# to qa. These specify:
|
||||
# 0: which qa command to run
|
||||
# 1,2,3.. it's parameters
|
||||
# except that -V, -I, -L (or lower-case) can be used to
|
||||
# define $MMQA_VERSION, $MPS_LINK_OBJ and $MPS_INCLUDE_DIR
|
||||
# which otherwise will be taken from environment variables.
|
||||
#
|
||||
# we'll set the relevant vars and pass the rest on in @qa_args
|
||||
# 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
|
||||
|
||||
@qa_args = ();
|
||||
# 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_options = ();
|
||||
$qa_options{"v"} = "MMQA_VERSION";
|
||||
$MMQA_VERSION = "MMQA_VERS_MO"; &use($MMQA_VERSION);
|
||||
$qa_options{"i"} = "MPS_INCLUDE_DIR";
|
||||
$qa_options{"l"} = "MPS_LINK_OBJ";
|
||||
$qa_command = shift(@ARGV);
|
||||
|
||||
while ($_ = shift(@ARGV)) {
|
||||
if (/^\-(.*)$/i) {
|
||||
unless ($qa_options{$1}) {
|
||||
die "Unrecognised option: $1.\n";
|
||||
}
|
||||
$val = shift(@ARGV); &use($val);
|
||||
$tetete="$".$qa_options{$1}." = \$val";
|
||||
eval $tetete;
|
||||
} else {
|
||||
push(@qa_args, $_);
|
||||
}
|
||||
unless ($qa_command) {
|
||||
die "You must specify a command -- try 'qa help' for details.\n";
|
||||
}
|
||||
|
||||
$qa_command = shift(@qa_args);
|
||||
|
||||
foreach (keys %qa_options) {
|
||||
unless (eval("$".$qa_options{$_})) {
|
||||
eval("$".$qa_options{$_}." = \$ENV{'".$qa_options{$_}."'}");
|
||||
unless (eval("$".$qa_options{$_})) {
|
||||
die "Error: please specify $qa_options{$_} (use the -$_ option).\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
unless (-e "$script_dir/commands/".$qa_command) {
|
||||
die "MM QA: unknown command '".$qa_command."'";
|
||||
die "Unknown command '".$qa_command."' -- 'qa help' for info.\n";
|
||||
}
|
||||
|
||||
require "optproc";
|
||||
|
||||
do "commands/".$qa_command;
|
||||
if ($@) {print $@};
|
||||
|
||||
#################
|
||||
|
||||
sub use {}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,7 +4,15 @@
|
|||
# putting the resulting .o files in $obj_dir.
|
||||
#
|
||||
|
||||
print "Compiling test libraries in $testlib_dir.\n";
|
||||
&options(
|
||||
"MPS_INCLUDE_DIR",
|
||||
"INTERFACE_VERSION",
|
||||
"PLATFORM"
|
||||
);
|
||||
|
||||
require "dirs";
|
||||
|
||||
print "Compiling test libraries from $testlib_dir.\n";
|
||||
|
||||
require "compile";
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,9 @@
|
|||
#
|
||||
# make an index of all the tests (all .c files) in the
|
||||
# current directory, and write it on stdout.
|
||||
#
|
||||
|
||||
&options();
|
||||
|
||||
require "headread";
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,14 @@
|
|||
# run tests interactively (allows for user input, immediate results,
|
||||
# &c, but doesn't give results in standard format)
|
||||
|
||||
&options(
|
||||
"MPS_INCLUDE_DIR",
|
||||
"MPS_LINK_OBJ",
|
||||
"INTERFACE_VERSION",
|
||||
"PLATFORM"
|
||||
);
|
||||
|
||||
require "dirs";
|
||||
require "headread";
|
||||
require "compile";
|
||||
|
||||
|
|
|
|||
|
|
@ -18,8 +18,8 @@ sub compiler_settings {
|
|||
$cc_opts = "-ansi -pedantic -Wall -Wstrict-prototypes \\
|
||||
-Winline -Waggregate-return -Wnested-externs -Wcast-qual \\
|
||||
-Wshadow -Wmissing-prototypes -Wredundant-decls -Wcast-align \\
|
||||
-O -g -ggdb3 -D$MMQA_VERSION";
|
||||
$cc_link = "$obj_dir/platform.o $plat_link{$platform_class}";
|
||||
-O -g -ggdb3 -DMMQA_VERS_$INTERFACE_VERSION";
|
||||
$cc_link = "$obj_dir/platform.o $plat_link{$PLATFORM}";
|
||||
$cc_include = "-I$testlib_dir -I$MPS_INCLUDE_DIR";
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue