runners: Renamed -a/--all -> --force
Test/bench filters have proven to be mostly non-optional, protecting against bad configuration that doesn't make any sense. It's still valid to want to override test filters sometimes, but using a more, uh, forceful verb probably makes sense here. The shortform would conflict with -f/--fail, so no shortform flag for this, but some argue --force should never have a shortform flag anyways.
This commit is contained in:
+14
-14
@@ -428,7 +428,7 @@ size_t bench_id_count = 1;
|
|||||||
size_t bench_step_start = 0;
|
size_t bench_step_start = 0;
|
||||||
size_t bench_step_stop = -1;
|
size_t bench_step_stop = -1;
|
||||||
size_t bench_step_step = 1;
|
size_t bench_step_step = 1;
|
||||||
bool bench_all = false;
|
bool bench_force = false;
|
||||||
|
|
||||||
const char *bench_disk_path = NULL;
|
const char *bench_disk_path = NULL;
|
||||||
const char *bench_trace_path = NULL;
|
const char *bench_trace_path = NULL;
|
||||||
@@ -842,7 +842,7 @@ void perm_count(
|
|||||||
|
|
||||||
state->total += 1;
|
state->total += 1;
|
||||||
|
|
||||||
if (!case_->run || !(bench_all || !case_->if_ || case_->if_())) {
|
if (!case_->run || !(bench_force || !case_->if_ || case_->if_())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1335,7 +1335,7 @@ void perm_run(
|
|||||||
bench_step += 1;
|
bench_step += 1;
|
||||||
|
|
||||||
// filter?
|
// filter?
|
||||||
if (!case_->run || !(bench_all || !case_->if_ || case_->if_())) {
|
if (!case_->run || !(bench_force || !case_->if_ || case_->if_())) {
|
||||||
printf("skipped ");
|
printf("skipped ");
|
||||||
perm_printid(suite, case_);
|
perm_printid(suite, case_);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -1432,18 +1432,18 @@ enum opt_flags {
|
|||||||
OPT_DEFINE = 'D',
|
OPT_DEFINE = 'D',
|
||||||
OPT_DEFINE_DEPTH = 6,
|
OPT_DEFINE_DEPTH = 6,
|
||||||
OPT_STEP = 's',
|
OPT_STEP = 's',
|
||||||
OPT_ALL = 'a',
|
OPT_FORCE = 7,
|
||||||
OPT_DISK = 'd',
|
OPT_DISK = 'd',
|
||||||
OPT_TRACE = 't',
|
OPT_TRACE = 't',
|
||||||
OPT_TRACE_BACKTRACE = 7,
|
OPT_TRACE_BACKTRACE = 8,
|
||||||
OPT_TRACE_PERIOD = 8,
|
OPT_TRACE_PERIOD = 9,
|
||||||
OPT_TRACE_FREQ = 9,
|
OPT_TRACE_FREQ = 10,
|
||||||
OPT_READ_SLEEP = 10,
|
OPT_READ_SLEEP = 11,
|
||||||
OPT_PROG_SLEEP = 11,
|
OPT_PROG_SLEEP = 12,
|
||||||
OPT_ERASE_SLEEP = 12,
|
OPT_ERASE_SLEEP = 13,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *short_opts = "hYlLD:s:ad:t:";
|
const char *short_opts = "hYlLD:s:d:t:";
|
||||||
|
|
||||||
const struct option long_opts[] = {
|
const struct option long_opts[] = {
|
||||||
{"help", no_argument, NULL, OPT_HELP},
|
{"help", no_argument, NULL, OPT_HELP},
|
||||||
@@ -1460,7 +1460,7 @@ const struct option long_opts[] = {
|
|||||||
{"define", required_argument, NULL, OPT_DEFINE},
|
{"define", required_argument, NULL, OPT_DEFINE},
|
||||||
{"define-depth", required_argument, NULL, OPT_DEFINE_DEPTH},
|
{"define-depth", required_argument, NULL, OPT_DEFINE_DEPTH},
|
||||||
{"step", required_argument, NULL, OPT_STEP},
|
{"step", required_argument, NULL, OPT_STEP},
|
||||||
{"all", no_argument, NULL, OPT_ALL},
|
{"force", no_argument, NULL, OPT_FORCE},
|
||||||
{"disk", required_argument, NULL, OPT_DISK},
|
{"disk", required_argument, NULL, OPT_DISK},
|
||||||
{"trace", required_argument, NULL, OPT_TRACE},
|
{"trace", required_argument, NULL, OPT_TRACE},
|
||||||
{"trace-backtrace", no_argument, NULL, OPT_TRACE_BACKTRACE},
|
{"trace-backtrace", no_argument, NULL, OPT_TRACE_BACKTRACE},
|
||||||
@@ -1808,8 +1808,8 @@ int main(int argc, char **argv) {
|
|||||||
fprintf(stderr, "error: invalid step: %s\n", optarg);
|
fprintf(stderr, "error: invalid step: %s\n", optarg);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
case OPT_ALL:;
|
case OPT_FORCE:;
|
||||||
bench_all = true;
|
bench_force = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_DISK:;
|
case OPT_DISK:;
|
||||||
|
|||||||
+14
-14
@@ -439,7 +439,7 @@ size_t test_id_count = 1;
|
|||||||
size_t test_step_start = 0;
|
size_t test_step_start = 0;
|
||||||
size_t test_step_stop = -1;
|
size_t test_step_stop = -1;
|
||||||
size_t test_step_step = 1;
|
size_t test_step_step = 1;
|
||||||
bool test_all = false;
|
bool test_force = false;
|
||||||
|
|
||||||
const char *test_disk_path = NULL;
|
const char *test_disk_path = NULL;
|
||||||
const char *test_trace_path = NULL;
|
const char *test_trace_path = NULL;
|
||||||
@@ -812,7 +812,7 @@ void perm_count(
|
|||||||
|
|
||||||
// set pls to 1 if running under powerloss so it useful for if predicates
|
// set pls to 1 if running under powerloss so it useful for if predicates
|
||||||
TEST_PLS = (powerloss->run != run_powerloss_none);
|
TEST_PLS = (powerloss->run != run_powerloss_none);
|
||||||
if (!case_->run || !(test_all || !case_->if_ || case_->if_())) {
|
if (!case_->run || !(test_force || !case_->if_ || case_->if_())) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1811,7 +1811,7 @@ void perm_run(
|
|||||||
// set pls to 1 if running under powerloss so it useful for if predicates
|
// set pls to 1 if running under powerloss so it useful for if predicates
|
||||||
TEST_PLS = (powerloss->run != run_powerloss_none);
|
TEST_PLS = (powerloss->run != run_powerloss_none);
|
||||||
// filter?
|
// filter?
|
||||||
if (!case_->run || !(test_all || !case_->if_ || case_->if_())) {
|
if (!case_->run || !(test_force || !case_->if_ || case_->if_())) {
|
||||||
printf("skipped ");
|
printf("skipped ");
|
||||||
perm_printid(suite, case_, NULL, 0);
|
perm_printid(suite, case_, NULL, 0);
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@@ -1869,18 +1869,18 @@ enum opt_flags {
|
|||||||
OPT_DEFINE_DEPTH = 7,
|
OPT_DEFINE_DEPTH = 7,
|
||||||
OPT_POWERLOSS = 'P',
|
OPT_POWERLOSS = 'P',
|
||||||
OPT_STEP = 's',
|
OPT_STEP = 's',
|
||||||
OPT_ALL = 'a',
|
OPT_FORCE = 8,
|
||||||
OPT_DISK = 'd',
|
OPT_DISK = 'd',
|
||||||
OPT_TRACE = 't',
|
OPT_TRACE = 't',
|
||||||
OPT_TRACE_BACKTRACE = 8,
|
OPT_TRACE_BACKTRACE = 9,
|
||||||
OPT_TRACE_PERIOD = 9,
|
OPT_TRACE_PERIOD = 10,
|
||||||
OPT_TRACE_FREQ = 10,
|
OPT_TRACE_FREQ = 11,
|
||||||
OPT_READ_SLEEP = 11,
|
OPT_READ_SLEEP = 12,
|
||||||
OPT_PROG_SLEEP = 12,
|
OPT_PROG_SLEEP = 13,
|
||||||
OPT_ERASE_SLEEP = 13,
|
OPT_ERASE_SLEEP = 14,
|
||||||
};
|
};
|
||||||
|
|
||||||
const char *short_opts = "hYlLD:P:s:ad:t:";
|
const char *short_opts = "hYlLD:P:s:d:t:";
|
||||||
|
|
||||||
const struct option long_opts[] = {
|
const struct option long_opts[] = {
|
||||||
{"help", no_argument, NULL, OPT_HELP},
|
{"help", no_argument, NULL, OPT_HELP},
|
||||||
@@ -1899,7 +1899,7 @@ const struct option long_opts[] = {
|
|||||||
{"define-depth", required_argument, NULL, OPT_DEFINE_DEPTH},
|
{"define-depth", required_argument, NULL, OPT_DEFINE_DEPTH},
|
||||||
{"powerloss", required_argument, NULL, OPT_POWERLOSS},
|
{"powerloss", required_argument, NULL, OPT_POWERLOSS},
|
||||||
{"step", required_argument, NULL, OPT_STEP},
|
{"step", required_argument, NULL, OPT_STEP},
|
||||||
{"all", no_argument, NULL, OPT_ALL},
|
{"force", no_argument, NULL, OPT_FORCE},
|
||||||
{"disk", required_argument, NULL, OPT_DISK},
|
{"disk", required_argument, NULL, OPT_DISK},
|
||||||
{"trace", required_argument, NULL, OPT_TRACE},
|
{"trace", required_argument, NULL, OPT_TRACE},
|
||||||
{"trace-backtrace", no_argument, NULL, OPT_TRACE_BACKTRACE},
|
{"trace-backtrace", no_argument, NULL, OPT_TRACE_BACKTRACE},
|
||||||
@@ -2414,8 +2414,8 @@ int main(int argc, char **argv) {
|
|||||||
fprintf(stderr, "error: invalid step: %s\n", optarg);
|
fprintf(stderr, "error: invalid step: %s\n", optarg);
|
||||||
exit(-1);
|
exit(-1);
|
||||||
|
|
||||||
case OPT_ALL:;
|
case OPT_FORCE:;
|
||||||
test_all = true;
|
test_force = true;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OPT_DISK:;
|
case OPT_DISK:;
|
||||||
|
|||||||
+3
-3
@@ -717,8 +717,8 @@ def find_runner(runner, id=None, main=True, **args):
|
|||||||
# other context
|
# other context
|
||||||
if args.get('define_depth'):
|
if args.get('define_depth'):
|
||||||
cmd.append('--define-depth=%s' % args['define_depth'])
|
cmd.append('--define-depth=%s' % args['define_depth'])
|
||||||
if args.get('all'):
|
if args.get('force'):
|
||||||
cmd.append('-a')
|
cmd.append('--force')
|
||||||
|
|
||||||
# only one thread should write to disk/trace, otherwise the output
|
# only one thread should write to disk/trace, otherwise the output
|
||||||
# ends up clobbered and useless
|
# ends up clobbered and useless
|
||||||
@@ -1616,7 +1616,7 @@ if __name__ == "__main__":
|
|||||||
'--define-depth',
|
'--define-depth',
|
||||||
help="How deep to evaluate recursive defines before erroring.")
|
help="How deep to evaluate recursive defines before erroring.")
|
||||||
bench_parser.add_argument(
|
bench_parser.add_argument(
|
||||||
'-a', '--all',
|
'--force',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help="Ignore bench filters.")
|
help="Ignore bench filters.")
|
||||||
bench_parser.add_argument(
|
bench_parser.add_argument(
|
||||||
|
|||||||
+3
-3
@@ -737,8 +737,8 @@ def find_runner(runner, id=None, main=True, **args):
|
|||||||
cmd.append('--define-depth=%s' % args['define_depth'])
|
cmd.append('--define-depth=%s' % args['define_depth'])
|
||||||
if args.get('powerloss'):
|
if args.get('powerloss'):
|
||||||
cmd.append('-P%s' % args['powerloss'])
|
cmd.append('-P%s' % args['powerloss'])
|
||||||
if args.get('all'):
|
if args.get('force'):
|
||||||
cmd.append('-a')
|
cmd.append('--force')
|
||||||
|
|
||||||
# only one thread should write to disk/trace, otherwise the output
|
# only one thread should write to disk/trace, otherwise the output
|
||||||
# ends up clobbered and useless
|
# ends up clobbered and useless
|
||||||
@@ -1639,7 +1639,7 @@ if __name__ == "__main__":
|
|||||||
'-P', '--powerloss',
|
'-P', '--powerloss',
|
||||||
help="Comma-separated list of power-loss scenarios to test.")
|
help="Comma-separated list of power-loss scenarios to test.")
|
||||||
test_parser.add_argument(
|
test_parser.add_argument(
|
||||||
'-a', '--all',
|
'--force',
|
||||||
action='store_true',
|
action='store_true',
|
||||||
help="Ignore test filters.")
|
help="Ignore test filters.")
|
||||||
test_parser.add_argument(
|
test_parser.add_argument(
|
||||||
|
|||||||
Reference in New Issue
Block a user