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_stop = -1;
|
||||
size_t bench_step_step = 1;
|
||||
bool bench_all = false;
|
||||
bool bench_force = false;
|
||||
|
||||
const char *bench_disk_path = NULL;
|
||||
const char *bench_trace_path = NULL;
|
||||
@@ -842,7 +842,7 @@ void perm_count(
|
||||
|
||||
state->total += 1;
|
||||
|
||||
if (!case_->run || !(bench_all || !case_->if_ || case_->if_())) {
|
||||
if (!case_->run || !(bench_force || !case_->if_ || case_->if_())) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1335,7 +1335,7 @@ void perm_run(
|
||||
bench_step += 1;
|
||||
|
||||
// filter?
|
||||
if (!case_->run || !(bench_all || !case_->if_ || case_->if_())) {
|
||||
if (!case_->run || !(bench_force || !case_->if_ || case_->if_())) {
|
||||
printf("skipped ");
|
||||
perm_printid(suite, case_);
|
||||
printf("\n");
|
||||
@@ -1432,18 +1432,18 @@ enum opt_flags {
|
||||
OPT_DEFINE = 'D',
|
||||
OPT_DEFINE_DEPTH = 6,
|
||||
OPT_STEP = 's',
|
||||
OPT_ALL = 'a',
|
||||
OPT_FORCE = 7,
|
||||
OPT_DISK = 'd',
|
||||
OPT_TRACE = 't',
|
||||
OPT_TRACE_BACKTRACE = 7,
|
||||
OPT_TRACE_PERIOD = 8,
|
||||
OPT_TRACE_FREQ = 9,
|
||||
OPT_READ_SLEEP = 10,
|
||||
OPT_PROG_SLEEP = 11,
|
||||
OPT_ERASE_SLEEP = 12,
|
||||
OPT_TRACE_BACKTRACE = 8,
|
||||
OPT_TRACE_PERIOD = 9,
|
||||
OPT_TRACE_FREQ = 10,
|
||||
OPT_READ_SLEEP = 11,
|
||||
OPT_PROG_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[] = {
|
||||
{"help", no_argument, NULL, OPT_HELP},
|
||||
@@ -1460,7 +1460,7 @@ const struct option long_opts[] = {
|
||||
{"define", required_argument, NULL, OPT_DEFINE},
|
||||
{"define-depth", required_argument, NULL, OPT_DEFINE_DEPTH},
|
||||
{"step", required_argument, NULL, OPT_STEP},
|
||||
{"all", no_argument, NULL, OPT_ALL},
|
||||
{"force", no_argument, NULL, OPT_FORCE},
|
||||
{"disk", required_argument, NULL, OPT_DISK},
|
||||
{"trace", required_argument, NULL, OPT_TRACE},
|
||||
{"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);
|
||||
exit(-1);
|
||||
|
||||
case OPT_ALL:;
|
||||
bench_all = true;
|
||||
case OPT_FORCE:;
|
||||
bench_force = true;
|
||||
break;
|
||||
|
||||
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_stop = -1;
|
||||
size_t test_step_step = 1;
|
||||
bool test_all = false;
|
||||
bool test_force = false;
|
||||
|
||||
const char *test_disk_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
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -1811,7 +1811,7 @@ void perm_run(
|
||||
// set pls to 1 if running under powerloss so it useful for if predicates
|
||||
TEST_PLS = (powerloss->run != run_powerloss_none);
|
||||
// filter?
|
||||
if (!case_->run || !(test_all || !case_->if_ || case_->if_())) {
|
||||
if (!case_->run || !(test_force || !case_->if_ || case_->if_())) {
|
||||
printf("skipped ");
|
||||
perm_printid(suite, case_, NULL, 0);
|
||||
printf("\n");
|
||||
@@ -1869,18 +1869,18 @@ enum opt_flags {
|
||||
OPT_DEFINE_DEPTH = 7,
|
||||
OPT_POWERLOSS = 'P',
|
||||
OPT_STEP = 's',
|
||||
OPT_ALL = 'a',
|
||||
OPT_FORCE = 8,
|
||||
OPT_DISK = 'd',
|
||||
OPT_TRACE = 't',
|
||||
OPT_TRACE_BACKTRACE = 8,
|
||||
OPT_TRACE_PERIOD = 9,
|
||||
OPT_TRACE_FREQ = 10,
|
||||
OPT_READ_SLEEP = 11,
|
||||
OPT_PROG_SLEEP = 12,
|
||||
OPT_ERASE_SLEEP = 13,
|
||||
OPT_TRACE_BACKTRACE = 9,
|
||||
OPT_TRACE_PERIOD = 10,
|
||||
OPT_TRACE_FREQ = 11,
|
||||
OPT_READ_SLEEP = 12,
|
||||
OPT_PROG_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[] = {
|
||||
{"help", no_argument, NULL, OPT_HELP},
|
||||
@@ -1899,7 +1899,7 @@ const struct option long_opts[] = {
|
||||
{"define-depth", required_argument, NULL, OPT_DEFINE_DEPTH},
|
||||
{"powerloss", required_argument, NULL, OPT_POWERLOSS},
|
||||
{"step", required_argument, NULL, OPT_STEP},
|
||||
{"all", no_argument, NULL, OPT_ALL},
|
||||
{"force", no_argument, NULL, OPT_FORCE},
|
||||
{"disk", required_argument, NULL, OPT_DISK},
|
||||
{"trace", required_argument, NULL, OPT_TRACE},
|
||||
{"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);
|
||||
exit(-1);
|
||||
|
||||
case OPT_ALL:;
|
||||
test_all = true;
|
||||
case OPT_FORCE:;
|
||||
test_force = true;
|
||||
break;
|
||||
|
||||
case OPT_DISK:;
|
||||
|
||||
+3
-3
@@ -717,8 +717,8 @@ def find_runner(runner, id=None, main=True, **args):
|
||||
# other context
|
||||
if args.get('define_depth'):
|
||||
cmd.append('--define-depth=%s' % args['define_depth'])
|
||||
if args.get('all'):
|
||||
cmd.append('-a')
|
||||
if args.get('force'):
|
||||
cmd.append('--force')
|
||||
|
||||
# only one thread should write to disk/trace, otherwise the output
|
||||
# ends up clobbered and useless
|
||||
@@ -1616,7 +1616,7 @@ if __name__ == "__main__":
|
||||
'--define-depth',
|
||||
help="How deep to evaluate recursive defines before erroring.")
|
||||
bench_parser.add_argument(
|
||||
'-a', '--all',
|
||||
'--force',
|
||||
action='store_true',
|
||||
help="Ignore bench filters.")
|
||||
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'])
|
||||
if args.get('powerloss'):
|
||||
cmd.append('-P%s' % args['powerloss'])
|
||||
if args.get('all'):
|
||||
cmd.append('-a')
|
||||
if args.get('force'):
|
||||
cmd.append('--force')
|
||||
|
||||
# only one thread should write to disk/trace, otherwise the output
|
||||
# ends up clobbered and useless
|
||||
@@ -1639,7 +1639,7 @@ if __name__ == "__main__":
|
||||
'-P', '--powerloss',
|
||||
help="Comma-separated list of power-loss scenarios to test.")
|
||||
test_parser.add_argument(
|
||||
'-a', '--all',
|
||||
'--force',
|
||||
action='store_true',
|
||||
help="Ignore test filters.")
|
||||
test_parser.add_argument(
|
||||
|
||||
Reference in New Issue
Block a user