#include "librpc/rpc/dcerpc.h"
#include "auth/gensec/gensec.h"
#include "param/param.h"
+#include "lib/util/samba_modules.h"
#if HAVE_READLINE_HISTORY_H
#include <readline/history.h>
}
}
-_NORETURN_ static void usage(poptContext pc)
+static void usage(poptContext pc)
{
poptPrintUsage(pc, stdout, 0);
printf("\n");
print_structured_testsuite_list();
- exit(1);
}
_NORETURN_ static void max_runtime_handler(int sig)
}
if (extra_module != NULL) {
- init_module_fn fn = load_module(talloc_autofree_context(), poptGetOptArg(pc));
+ init_module_fn fn = load_module(poptGetOptArg(pc), false, NULL);
if (fn == NULL)
d_printf("Unable to load module from %s\n", poptGetOptArg(pc));
}
if (list_tests) {
- for (i=1;i<argc_new;i++) {
- print_test_list(torture_root, NULL, argv_new[i]);
+ if (argc_new == 1) {
+ print_test_list(torture_root, NULL, "");
+ } else {
+ for (i=1;i<argc_new;i++) {
+ print_test_list(torture_root, NULL, argv_new[i]);
+ }
}
return 0;
}
torture->lp_ctx = cmdline_lp_ctx;
- gensec_init(cmdline_lp_ctx);
+ gensec_init();
if (shell) {
/* In shell mode, just ignore any remaining test names. */
if (argc_new < 3) {
printf("You must specify a test to run, or 'ALL'\n");
usage(pc);
- exit(1);
- }
-
+ torture->results->returncode = 1;
+ } else if (!torture_parse_target(cmdline_lp_ctx, argv_new[1])) {
/* Take the target name or binding. */
- if (!torture_parse_target(cmdline_lp_ctx, argv_new[1])) {
usage(pc);
- exit(1);
- }
-
- for (i=2;i<argc_new;i++) {
- if (!torture_run_named_tests(torture, argv_new[i],
- (const char **)restricted)) {
- correct = false;
+ torture->results->returncode = 1;
+ } else {
+ for (i=2;i<argc_new;i++) {
+ if (!torture_run_named_tests(torture, argv_new[i],
+ (const char **)restricted)) {
+ correct = false;
+ }
}
}
}