diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2007-01-26 13:03:28 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:44:21 -0500 |
commit | 5c847a00a7eccc190b1d63a3fca1420db8543edf (patch) | |
tree | 0db38b2d981af7c03749d64bef1a396ee654c05e /source4/torture | |
parent | 0c45d415ffa1cb96e07fbec805d80a98bcd7547e (diff) | |
download | samba-5c847a00a7eccc190b1d63a3fca1420db8543edf.tar.gz samba-5c847a00a7eccc190b1d63a3fca1420db8543edf.tar.bz2 samba-5c847a00a7eccc190b1d63a3fca1420db8543edf.zip |
r21028: Generate list of tests rather than maintaining it manually.
(This used to be commit 7de4727ceb5935dd5fca49db0331c4509f735362)
Diffstat (limited to 'source4/torture')
-rw-r--r-- | source4/torture/smbtorture.c | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/source4/torture/smbtorture.c b/source4/torture/smbtorture.c index 018c7260af..016f3e603e 100644 --- a/source4/torture/smbtorture.c +++ b/source4/torture/smbtorture.c @@ -163,6 +163,23 @@ static void parse_dns(const char *dns) } +static void print_test_list(void) +{ + struct torture_suite *o; + struct torture_suite *s; + struct torture_tcase *t; + + for (o = torture_root->children; o; o = o->next) { + for (s = o->children; s; s = s->next) { + printf("%s-%s\n", o->name, s->name); + } + + for (t = o->testcases; t; t = t->next) { + printf("%s-%s\n", o->name, t->name); + } + } +} + static void usage(poptContext pc) { struct torture_suite *o; @@ -487,7 +504,8 @@ int main(int argc,char *argv[]) NTSTATUS status; int shell = False; static const char *ui_ops_name = "simple"; - enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, + static int list_tests = 0; + enum {OPT_LOADFILE=1000,OPT_UNCLIST,OPT_TIMELIMIT,OPT_DNS, OPT_LIST, OPT_DANGEROUS,OPT_SMB_PORTS,OPT_ASYNC,OPT_NUMPROGS, OPT_BASEDIR}; struct poptOption long_options[] = { @@ -500,6 +518,7 @@ int main(int argc,char *argv[]) {"num-ops", 0, POPT_ARG_INT, &torture_numops, 0, "num ops", NULL}, {"entries", 0, POPT_ARG_INT, &torture_entries, 0, "entries", NULL}, {"loadfile", 0, POPT_ARG_STRING, NULL, OPT_LOADFILE, "loadfile", NULL}, + {"list", 0, POPT_ARG_NONE, &list_tests, 0, NULL, NULL }, {"unclist", 0, POPT_ARG_STRING, NULL, OPT_UNCLIST, "unclist", NULL}, {"timelimit", 't', POPT_ARG_INT, NULL, OPT_TIMELIMIT, "timelimit", NULL}, {"failures", 'f', POPT_ARG_INT, &torture_failures, 0, "failures", NULL}, @@ -584,6 +603,11 @@ int main(int argc,char *argv[]) torture_init(); ldb_global_init(); + if (list_tests) { + print_test_list(); + return 0; + } + subunit_dir = lp_parm_string_list(-1, "torture", "subunitdir", ":"); if (subunit_dir == NULL) torture_subunit_load_testsuites(dyn_TORTUREDIR, true, NULL); |