Skip to content

Commit 60a8a9d

Browse files
authored
Merge pull request #11568 from JuhPuur/unittest_speedup
Speed up unit test build with parallel jobs
2 parents 727b089 + b836256 commit 60a8a9d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

UNITTESTS/unit_test/test.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import os
2222
import logging
2323
import sys
24+
import psutil
2425
from shutil import copy
2526

2627
from .utils import execute_program
@@ -106,6 +107,11 @@ def build_tests(self):
106107

107108
args = [self.make_program]
108109

110+
# Speed up compilation by running on more than one core
111+
count = psutil.cpu_count()
112+
args.append("-j{}".format(count+1))
113+
args.append("-l{}".format(count))
114+
109115
if logging.getLogger().getEffectiveLevel() == logging.DEBUG:
110116
args.append("VERBOSE=1")
111117

0 commit comments

Comments
 (0)