diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2014-11-01 15:13:18 -0700 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2014-11-30 14:22:05 +0100 |
commit | 0f408599f83f5d8e68f0fb0f765143aa6620651e (patch) | |
tree | a834d1a492d1047a2a9419890f90637772b08c2b /selftest/selftest.pl | |
parent | c3855dae71e557b824ad2679acd8bb5ad85936e2 (diff) | |
download | samba-0f408599f83f5d8e68f0fb0f765143aa6620651e.tar.gz |
selftest: Add separate command line for listing tests, allowing us of subunit-filter (which doesn't support subunit v2).
Change-Id: Icb877214a422c63fd38ef92425c7b4fe7ee19ad5
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'selftest/selftest.pl')
-rwxr-xr-x | selftest/selftest.pl | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl index 34ae6056efd..ea63ee528b5 100755 --- a/selftest/selftest.pl +++ b/selftest/selftest.pl @@ -574,10 +574,15 @@ sub read_testlist($) $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]); + push (@ret, [$name, $env, $cmdline, $loadlist]); } } else { print; @@ -937,11 +942,12 @@ $envvarstr 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". @@ -949,14 +955,12 @@ $envvarstr 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; |