1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00

selftest: Drop support for TESTSUITE-IDLIST, and remove its last user.

Change-Id: Ic616676bb770fa4769195d73c4309915646caae0
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Jelmer Vernooij 2014-10-26 20:17:20 -07:00
parent 13a1406fa1
commit f6e3cd7f03
4 changed files with 9 additions and 26 deletions

View File

@ -568,9 +568,8 @@ sub read_testlist($)
open(IN, $filename) or die("Unable to open $filename: $!"); open(IN, $filename) or die("Unable to open $filename: $!");
while (<IN>) { while (<IN>) {
if (/-- TEST(-LOADLIST|-IDLIST|) --\n/) { if (/-- TEST(-LOADLIST|) --\n/) {
my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST"); my $supports_loadlist = (defined($1) and $1 eq "-LOADLIST");
my $supports_idlist = (defined($1) and $1 eq "-IDLIST");
my $name = <IN>; my $name = <IN>;
$name =~ s/\n//g; $name =~ s/\n//g;
my $env = <IN>; my $env = <IN>;
@ -578,7 +577,7 @@ sub read_testlist($)
my $cmdline = <IN>; my $cmdline = <IN>;
$cmdline =~ s/\n//g; $cmdline =~ s/\n//g;
if (should_run_test($name) == 1) { if (should_run_test($name) == 1) {
push (@ret, [$name, $env, $cmdline, $supports_loadlist, $supports_idlist]); push (@ret, [$name, $env, $cmdline, $supports_loadlist]);
} }
} else { } else {
print; print;
@ -823,7 +822,6 @@ sub setup_env($$)
} }
} }
return undef unless defined($testenv_vars); return undef unless defined($testenv_vars);
$running_envs{$envname} = $testenv_vars; $running_envs{$envname} = $testenv_vars;
@ -995,9 +993,8 @@ $envvarstr
print $fh substr($test, length($name)+1) . "\n"; print $fh substr($test, length($name)+1) . "\n";
} }
$cmd =~ s/\$LOADLIST/--load-list=$listid_file/g; $cmd =~ s/\$LOADLIST/--load-list=$listid_file/g;
} elsif ($$_[4]) { } else {
$cmd =~ s/\s+[^\s]+\s*$//; warn("Unable to run individual tests in $name, it does not support --loadlist.");
$cmd .= " " . join(' ', @{$individual_tests->{$name}});
} }
} }

View File

@ -133,19 +133,6 @@ def plantestsuite_loadlist(name, env, cmdline):
print "%s $LOADLIST 2>&1 | %s" % (cmdline, add_prefix(name, env, support_list)) print "%s $LOADLIST 2>&1 | %s" % (cmdline, add_prefix(name, env, support_list))
def plantestsuite_idlist(name, env, cmdline):
print "-- TEST-IDLIST --"
if env == "none":
fullname = name
else:
fullname = "%s(%s)" % (name, env)
print fullname
print env
if isinstance(cmdline, list):
cmdline = " ".join(cmdline)
print cmdline
def skiptestsuite(name, reason): def skiptestsuite(name, reason):
"""Indicate that a testsuite was skipped. """Indicate that a testsuite was skipped.
@ -178,10 +165,10 @@ def planpythontestsuite(env, module, name=None, extra_path=[]):
"%s/lib/testtools" % srcdir(), "%s/lib/testtools" % srcdir(),
"%s/lib/extras" % srcdir(), "%s/lib/extras" % srcdir(),
"%s/lib/mimeparse" % srcdir()]) "%s/lib/mimeparse" % srcdir()])
args = [python, "-m", "subunit.run", "$LISTOPT", module] args = [python, "-m", "subunit.run", "$LISTOPT", "$LOADLIST", module]
if pypath: if pypath:
args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath)) args.insert(0, "PYTHONPATH=%s" % ":".join(["$PYTHONPATH"] + pypath))
plantestsuite_idlist(name, env, args) plantestsuite_loadlist(name, env, args)
def get_env_torture_options(): def get_env_torture_options():

View File

@ -79,11 +79,10 @@ def read_testlist(inf, outf):
return return
if l.startswith("-- TEST") and l.endswith(" --\n"): if l.startswith("-- TEST") and l.endswith(" --\n"):
supports_loadlist = l.startswith("-- TEST-LOADLIST") supports_loadlist = l.startswith("-- TEST-LOADLIST")
supports_idlist = l.startswith("-- TEST-IDLIST")
name = inf.readline().rstrip("\n") name = inf.readline().rstrip("\n")
env = inf.readline().rstrip("\n") env = inf.readline().rstrip("\n")
cmdline = inf.readline().rstrip("\n") cmdline = inf.readline().rstrip("\n")
yield (name, env, cmdline, supports_loadlist, supports_idlist) yield (name, env, cmdline, supports_loadlist)
else: else:
outf.write(l) outf.write(l)

View File

@ -67,14 +67,14 @@ class ReadTestlistTests(TestCase):
def test_read_list(self): def test_read_list(self):
inf = StringIO("-- TEST --\nfoo\nbar\nbla\n") inf = StringIO("-- TEST --\nfoo\nbar\nbla\n")
outf = StringIO() outf = StringIO()
self.assertEquals([('foo', 'bar', 'bla', False, False)], self.assertEquals([('foo', 'bar', 'bla', False)],
list(read_testlist(inf, outf))) list(read_testlist(inf, outf)))
self.assertEquals("", outf.getvalue()) self.assertEquals("", outf.getvalue())
def test_read_list_passes_through(self): def test_read_list_passes_through(self):
inf = StringIO("MORENOISE\n-- TEST --\nfoo\nbar\nbla\nNOISE\n") inf = StringIO("MORENOISE\n-- TEST --\nfoo\nbar\nbla\nNOISE\n")
outf = StringIO() outf = StringIO()
self.assertEquals([('foo', 'bar', 'bla', False, False)], self.assertEquals([('foo', 'bar', 'bla', False)],
list(read_testlist(inf, outf))) list(read_testlist(inf, outf)))
self.assertEquals("MORENOISE\nNOISE\n", outf.getvalue()) self.assertEquals("MORENOISE\nNOISE\n", outf.getvalue())