Skip to content
Snippets Groups Projects
Commit 9384184a authored by Alexandre Julliard's avatar Alexandre Julliard
Browse files

Rewrote runtest in Perl so that it can be used on the Windows side.

Added options for include directories, debug level and target platform.
selection.
parent ebd225cb
No related branches found
No related tags found
No related merge requests found
...@@ -61,6 +61,7 @@ ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL) ...@@ -61,6 +61,7 @@ ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
WINETEST = $(TOPOBJDIR)/programs/winetest/winetest WINETEST = $(TOPOBJDIR)/programs/winetest/winetest
RUNTEST = $(TOPSRCDIR)/programs/winetest/runtest RUNTEST = $(TOPSRCDIR)/programs/winetest/runtest
RUNTESTFLAGS = -q -P wine -T $(TOPOBJDIR)
TESTRESULTS = $(PLTESTS:.pl=.ok) $(CTESTS:.c=.ok) TESTRESULTS = $(PLTESTS:.pl=.ok) $(CTESTS:.c=.ok)
WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
MAKEDEP = $(TOPOBJDIR)/tools/makedep MAKEDEP = $(TOPOBJDIR)/tools/makedep
...@@ -127,7 +128,7 @@ LINTS = $(C_SRCS:.c=.ln) ...@@ -127,7 +128,7 @@ LINTS = $(C_SRCS:.c=.ln)
$(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 ) $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
.pl.ok: .pl.ok:
$(RUNTEST) $(TOPOBJDIR) $< $(RUNTESTFLAGS) && touch $@ $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
.PHONY: all install uninstall clean distclean depend dummy test testclean .PHONY: all install uninstall clean distclean depend dummy test testclean
......
...@@ -198,6 +198,9 @@ print NEWMAKE sort @depends; ...@@ -198,6 +198,9 @@ print NEWMAKE sort @depends;
print NEWMAKE <<EOF; print NEWMAKE <<EOF;
# Misc rules # Misc rules
\$(SUBDIRS:%=%/__test__): dummy
\@cd `dirname \$\@` && \$(MAKE) test
\$(SUBDIRS:%=%/__checklink__): dummy \$(SUBDIRS:%=%/__checklink__): dummy
\@cd `dirname \$\@` && \$(MAKE) checklink \@cd `dirname \$\@` && \$(MAKE) checklink
...@@ -208,6 +211,8 @@ install:: \$(SUBDIRS:%=%/__install__) ...@@ -208,6 +211,8 @@ install:: \$(SUBDIRS:%=%/__install__)
uninstall:: \$(SUBDIRS:%=%/__uninstall__) uninstall:: \$(SUBDIRS:%=%/__uninstall__)
test:: \$(SUBDIRS:%=%/__test__)
checklink:: \$(SUBDIRS:%=%/__checklink__) checklink:: \$(SUBDIRS:%=%/__checklink__)
debug_channels:: \$(SUBDIRS:%=%/__debug_channels__) debug_channels:: \$(SUBDIRS:%=%/__debug_channels__)
......
#!/bin/sh #!/usr/bin/perl
# #
# Wrapper script to run tests from inside the Wine tree # Wrapper script to run tests from inside the Wine tree
# #
# Usage: runtest $TOPOBJDIR input_file [flags...] # Usage: runtest [options] input_file [perl_args...]
# #
usage()
sub usage
{ {
echo "Usage: $0 \$TOPOBJDIR input_file [flags]" print STDERR <<EOF;
exit 1
Usage: $0 [options] input_file [perl_args...]
Options:
-q quiet mode
-v verbose mode (can be specified multiple times)
-I dir prepend dir to Perl include path
-P name set the current platform name
-T dir set Wine tree top directory (autodetected if not specified)
EOF
exit 1;
} }
if [ $# -lt 2 ] # default values
then $platform = $ENV{WINETEST_PLATFORM};
usage $ENV{WINETEST_DEBUG} ||= 1;
fi
# parse command-line options
while ($#ARGV >= 0)
{
$arg = shift @ARGV;
if ($arg eq "-h") { usage; }
if ($arg eq "-q") { $ENV{WINETEST_DEBUG} = 0; next; }
if ($arg eq "-v") { $ENV{WINETEST_DEBUG}++; next; }
if ($arg eq "-I") { $ENV{WINETEST_DEBUG} = 0; next; }
if ($arg eq "-P") { $platform = shift @ARGV; next; }
if ($arg eq "-I") { push @include_dirs, shift @ARGV; next; }
if ($arg eq "-T")
{
$topobjdir = shift @ARGV;
usage unless (-d $topobjdir);
next;
}
$infile = $arg;
last;
}
# we must have found an input file
usage unless defined($infile);
# check/detect topobjdir
if (defined($topobjdir))
{
unless (-f $topobjdir . "/server/wineserver")
{
printf STDERR "Wrong -T argument, %s/server/wineserver does not exist\n", $topobjdir;
usage;
}
}
else # try to detect it automatically
{
if (-f "./server/wineserver") { $topobjdir = "."; }
elsif (-f "../server/wineserver") { $topobjdir = ".."; }
elsif (-f "../../server/wineserver") { $topobjdir = "../.."; }
elsif (-f "../../../server/wineserver") { $topobjdir = "../../.."; }
}
if [ -d "$1" ] # set environment variables needed for Wine
then if (defined($topobjdir))
topobjdir=`cd "$1" && pwd` {
chop($topobjdir = `cd $topobjdir && pwd`);
$ENV{LD_LIBRARY_PATH} = $topobjdir . "/dlls:" . $topobjdir . ":" . $ENV{LD_LIBRARY_PATH};
$ENV{WINESERVER} ||= $topobjdir . "/server/wineserver";
$ENV{WINELOADER} ||= $topobjdir . "/wine";
$ENV{WINETEST_PLATFORM} = $platform || "wine";
}
else else
echo "$1 is not a directory" {
usage $ENV{WINETEST_PLATFORM} = $platform || "windows";
fi }
LD_LIBRARY_PATH="$topobjdir/dlls:$topobjdir:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH # check for include/ dir in script source directory and append it to search path
WINESERVER="$topobjdir/server/wineserver" my $basedir = $0;
export WINESERVER if ($basedir =~ /\//) { $basedir =~ s!/[^/]+$!!; }
WINELOADER="$topobjdir/wine" else { $basedir = "."; }
export WINELOADER if (-d $basedir . "/include") { push @include_dirs, $basedir . "/include"; }
testdir=`dirname "$0"`
infile="$2" $ENV{PERL5LIB} = join( ":", @include_dirs, split( ":", $ENV{PERL5LIB} ) );
shift 2
exec $topobjdir/programs/winetest/winetest -- -I "$testdir" $infile $@ # and now exec winetest
if (defined($topobjdir))
{
exec $topobjdir . "/programs/winetest/winetest", "--", $infile, @ARGV;
}
exec "winetest", $infile, @ARGV;
print STDERR "Could not exec winetest\n";
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment