summaryrefslogtreecommitdiff
path: root/selftest
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2010-12-09 14:46:09 +0100
committerJelmer Vernooij <jelmer@samba.org>2010-12-10 03:04:06 +0100
commite6974b0ff0100bb292d57e58ae11bc2e6b0d4053 (patch)
treefd706e73123eb34c6a3050b9bfb3b9eac6422f6a /selftest
parent34adc745efa242b7e4167b581d6770560e759e40 (diff)
downloadsamba-e6974b0ff0100bb292d57e58ae11bc2e6b0d4053.tar.gz
samba-e6974b0ff0100bb292d57e58ae11bc2e6b0d4053.tar.bz2
samba-e6974b0ff0100bb292d57e58ae11bc2e6b0d4053.zip
selftest: add --list option.
Diffstat (limited to 'selftest')
-rwxr-xr-xselftest/selftest.pl20
1 files changed, 20 insertions, 0 deletions
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 568850189d..2ba68d284b 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -153,6 +153,7 @@ my @opt_include = ();
my $opt_verbose = 0;
my $opt_image = undef;
my $opt_testenv = 0;
+my $opt_list = 0;
my $ldap = undef;
my $opt_resetup_env = undef;
my $opt_bindir = undef;
@@ -326,6 +327,7 @@ Behaviour:
--one abort when the first test fails
--verbose be verbose
--testenv run a shell in the requested test environment
+ --list list available tests
";
exit(0);
}
@@ -346,6 +348,7 @@ my $result = GetOptions (
'exeext=s' => \$exeext,
'verbose' => \$opt_verbose,
'testenv' => \$opt_testenv,
+ 'list' => \$opt_list,
'ldap:s' => \$ldap,
'resetup-environment' => \$opt_resetup_env,
'bindir:s' => \$opt_bindir,
@@ -358,6 +361,8 @@ exit(1) if (not $result);
ShowHelp() if ($opt_help);
+die("--list and --testenv are mutually exclusive") if ($opt_list and $opt_testenv);
+
# we want unbuffered output
$| = 1;
@@ -940,6 +945,21 @@ SMB_CONF_PATH=\$SMB_CONF_PATH
$envvarstr
\" && LD_LIBRARY_PATH=$ENV{LD_LIBRARY_PATH} bash'");
teardown_env($testenv_name);
+} elsif ($opt_list) {
+ foreach (@todo) {
+ my $cmd = $$_[2];
+ my $name = $$_[0];
+ my $envname = $$_[1];
+
+ unless($cmd =~ /\$LIST/) {
+ warn("Unable to list tests in $name");
+ next;
+ }
+
+ $cmd =~ s/\$LIST/--list/;
+
+ system($cmd);
+ }
} else {
foreach (@todo) {
$i++;