Added -a/--all to test.py/bench.py for bypass test/bench filters

These really shouldn't be used all that often. Test filters are usually
used to protect against invalid test configurations, so if you bypass
test filters, expect things to fail!

But some filters just prevent test cases from taking too long. In these
cases being able to manually bypass the filter is useful for debugging/
benchmarking/etc...
This commit is contained in:
Christopher Haster
2024-05-28 16:45:26 -05:00
parent 37f738cc71
commit 31eebc1328
4 changed files with 36 additions and 8 deletions
+12 -4
View File
@@ -439,6 +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;
const char *test_disk_path = NULL;
const char *test_trace_path = NULL;
@@ -811,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_->if_ && !case_->if_()) {
if (!test_all && case_->if_ && !case_->if_()) {
return;
}
@@ -1811,7 +1812,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_->if_ && !case_->if_()) {
if (!test_all && case_->if_ && !case_->if_()) {
printf("skipped ");
perm_printid(suite, case_, NULL, 0);
printf("\n");
@@ -1869,6 +1870,7 @@ enum opt_flags {
OPT_DEFINE_DEPTH = 7,
OPT_POWERLOSS = 'P',
OPT_STEP = 's',
OPT_ALL = 'a',
OPT_DISK = 'd',
OPT_TRACE = 't',
OPT_TRACE_BACKTRACE = 8,
@@ -1879,7 +1881,7 @@ enum opt_flags {
OPT_ERASE_SLEEP = 13,
};
const char *short_opts = "hYlLD:P:s:d:t:";
const char *short_opts = "hYlLD:P:s:ad:t:";
const struct option long_opts[] = {
{"help", no_argument, NULL, OPT_HELP},
@@ -1898,6 +1900,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},
{"disk", required_argument, NULL, OPT_DISK},
{"trace", required_argument, NULL, OPT_TRACE},
{"trace-backtrace", no_argument, NULL, OPT_TRACE_BACKTRACE},
@@ -1923,7 +1926,8 @@ const char *const help_text[] = {
"Override a test define.",
"How deep to evaluate recursive defines before erroring.",
"Comma-separated list of power-loss scenarios to test.",
"Comma-separated range of test permutations to run (start,stop,step).",
"Comma-separated range of permutations to run.",
"Ignore test filters.",
"Direct block device operations to this file.",
"Direct trace output to this file.",
"Include a backtrace with every trace statement.",
@@ -2411,6 +2415,10 @@ int main(int argc, char **argv) {
fprintf(stderr, "error: invalid step: %s\n", optarg);
exit(-1);
case OPT_ALL:;
test_all = true;
break;
case OPT_DISK:;
test_disk_path = optarg;
break;