Skip to content

Commit

Permalink
regtesting: Add --skipdir option to do_regtest.py
Browse files Browse the repository at this point in the history
  • Loading branch information
oschuett committed May 9, 2022
1 parent b4c4f02 commit ccdbba7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tools/regtesting/do_regtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ async def main() -> None:
parser.add_argument("--keepalive", dest="keepalive", action="store_true")
parser.add_argument("--debug", action="store_true")
parser.add_argument("--restrictdir", action="append")
parser.add_argument("--skipdir", action="append")
parser.add_argument("--workbasedir", type=Path)
parser.add_argument("arch")
parser.add_argument("version")
Expand Down Expand Up @@ -121,17 +122,21 @@ async def main() -> None:

# Create async tasks.
tasks = []
num_restrictdirs = 0
num_restrictdirs = num_skipdirs = 0
for batch in batches:
if not batch.requirements_satisfied(flags, cfg.mpiranks):
print(f"Skipping {batch.name} because its requirements are not satisfied.")
elif not any(re.fullmatch(p, batch.name) for p in cfg.restrictdirs):
num_restrictdirs += 1
elif any(re.fullmatch(p, batch.name) for p in cfg.skipdirs):
num_skipdirs += 1
else:
tasks.append(asyncio.get_event_loop().create_task(run_batch(batch, cfg)))

if num_restrictdirs:
print(f"Skipping {num_restrictdirs} test directories because of --restrictdir.")
if num_skipdirs:
print(f"Skipping {num_skipdirs} test directories because of --skipdir.")
if not tasks:
print("\nNo test directories selected, check --restrictdir filter.")
sys.exit(1)
Expand Down Expand Up @@ -205,6 +210,7 @@ def __init__(self, args: argparse.Namespace):
self.debug = args.debug
self.max_errors = args.maxerrors
self.restrictdirs = args.restrictdir if args.restrictdir else [".*"]
self.skipdirs = args.skipdir if args.skipdir else []
datestamp = datetime.now().strftime("%Y-%m-%d_%H-%M-%S")
leaf_dir = f"TEST-{args.arch}-{args.version}-{datestamp}"
self.work_base_dir = (
Expand Down

0 comments on commit ccdbba7

Please sign in to comment.