Skip to content

Commit 6b2bfd4

Browse files
committed
cli_coverage: Add --parallel-mode
1 parent a8bb5fd commit 6b2bfd4

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

pyfrc/mains/cli_coverage.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,10 @@ class PyFrcCoverage:
1111
the coverage module to be installed.
1212
"""
1313

14-
def __init__(self, parser):
14+
def __init__(self, parser: argparse.ArgumentParser):
15+
parser.add_argument(
16+
"--parallel-mode", action="store_true", help="Run coverage in parallel mode"
17+
)
1518
parser.add_argument(
1619
"args", nargs=argparse.REMAINDER, help="Arguments to pass to robot.py"
1720
)
@@ -45,13 +48,20 @@ def run(self, options, robot_class, **static_options):
4548
"run",
4649
"--source",
4750
dirname(file_location),
48-
file_location,
49-
] + list(options.args)
51+
]
52+
if options.parallel_mode:
53+
args.append("--parallel-mode")
54+
55+
args.append(file_location)
56+
args += option_args
5057

5158
retval = subprocess.call(args)
5259
if retval != 0:
5360
return retval
5461

62+
if options.parallel_mode:
63+
subprocess.call([sys.executable, "-m", "coverage", "combine"])
64+
5565
args = [sys.executable, "-m", "coverage", "report", "-m"]
5666

5767
return subprocess.call(args)

0 commit comments

Comments
 (0)