my $opt_binary_mapping = "";
my $opt_load_list = undef;
my $opt_libnss_wrapper_so_path = "";
+my $opt_libresolv_wrapper_so_path = "";
my $opt_libsocket_wrapper_so_path = "";
my $opt_libuid_wrapper_so_path = "";
my @testlists = ();
--help this help page
--target=samba[3]|win Samba version to target
--testlist=FILE file to read available tests from
+ --exclude=FILE Exclude tests listed in the file
+ --include=FILE Include tests listed in the file
Paths:
--prefix=DIR prefix to run tests in [st]
Preload cwrap:
--nss_wrapper_so_path=FILE the nss_wrapper library to preload
+ --resolv_wrapper_so_path=FILE the resolv_wrapper library to preload
--socket_wrapper_so_path=FILE the socket_wrapper library to preload
--uid_wrapper_so_path=FILE the uid_wrapper library to preload
'load-list=s' => \$opt_load_list,
'binary-mapping=s' => \$opt_binary_mapping,
'nss_wrapper_so_path=s' => \$opt_libnss_wrapper_so_path,
+ 'resolv_wrapper_so_path=s' => \$opt_libresolv_wrapper_so_path,
'socket_wrapper_so_path=s' => \$opt_libsocket_wrapper_so_path,
'uid_wrapper_so_path=s' => \$opt_libuid_wrapper_so_path
);
}
}
+if ($opt_libresolv_wrapper_so_path) {
+ if ($ld_preload) {
+ $ld_preload = "$ld_preload:$opt_libresolv_wrapper_so_path";
+ } else {
+ $ld_preload = "$opt_libresolv_wrapper_so_path";
+ }
+}
+
if ($opt_libsocket_wrapper_so_path) {
if ($ld_preload) {
$ld_preload = "$ld_preload:$opt_libsocket_wrapper_so_path";
open(IN, $filename) or die("Unable to open $filename: $!");
while (<IN>) {
- if (/-- TEST(-LOADLIST|-IDLIST|) --\n/) {
+ if (/-- TEST(-LOADLIST|) --\n/) {
my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST");
- my $supports_idlist = (defined($1) and $1 eq "-IDLIST");
my $name = <IN>;
$name =~ s/\n//g;
my $env = <IN>;
$env =~ s/\n//g;
+ my $loadlist;
+ if ($supports_loadlist) {
+ $loadlist = <IN>;
+ $loadlist =~ s/\n//g;
+ }
my $cmdline = <IN>;
$cmdline =~ s/\n//g;
if (should_run_test($name) == 1) {
- push (@ret, [$name, $env, $cmdline, $supports_loadlist, $supports_idlist]);
+ push (@ret, [$name, $env, $cmdline, $loadlist]);
}
} else {
print;
}
}
-
return undef unless defined($testenv_vars);
$running_envs{$envname} = $testenv_vars;
teardown_env($testenv_name);
} elsif ($opt_list) {
foreach (@todo) {
- my $cmd = $$_[2];
my $name = $$_[0];
my $envname = $$_[1];
+ my $cmd = $$_[2];
+ my $listcmd = $$_[3];
- unless($cmd =~ /\$LISTOPT/) {
+ unless (defined($listcmd)) {
warn("Unable to list tests in $name");
# Rather than ignoring this testsuite altogether, just pretend the entire testsuite is
# a single "test".
next;
}
- $cmd =~ s/\$LISTOPT/--list/g;
-
- system($cmd);
+ system($listcmd);
if ($? == -1) {
- die("Unable to run $cmd: $!");
+ die("Unable to run $listcmd: $!");
} elsif ($? & 127) {
- die(sprintf("%s died with signal %d, %s coredump\n", $cmd, ($? & 127), ($? & 128) ? 'with' : 'without'));
+ die(sprintf("%s died with signal %d, %s coredump\n", $listcmd, ($? & 127), ($? & 128) ? 'with' : 'without'));
}
my $exitcode = $? >> 8;
print $fh substr($test, length($name)+1) . "\n";
}
$cmd =~ s/\$LOADLIST/--load-list=$listid_file/g;
- } elsif ($$_[4]) {
- $cmd =~ s/\s+[^\s]+\s*$//;
- $cmd .= " " . join(' ', @{$individual_tests->{$name}});
+ } else {
+ warn("Unable to run individual tests in $name, it does not support --loadlist.");
}
}