Fix a bug in 'make check GLOBAL_SCHEDULER=1'.
* build/run_tests.py
(TestHarness.Job._command_line, TestHarness.CollectingThread._count_py_tests):
Use sys.executable.
(TestHarness._run_global_scheduler): Ask a question.
@@ -327,7 +327,7 @@ class TestHarness:
def _command_line(self, harness):
if self.is_python:
cmdline = list(harness.py_test_cmdline)
- cmdline.insert(0, 'python')
+ cmdline.insert(0, sys.executable)
cmdline.insert(1, self.progabs)
# Run the test apps in "child process" mode,
# i.e. w/o cleaning up global directories etc.
@@ -375,7 +375,7 @@ class TestHarness:
def _count_py_tests(self, progabs, progdir, progbase):
'Run a c test, escaping parameters as required.'
- cmdline = [ 'python', progabs, '--list' ]
+ cmdline = [ sys.executable, progabs, '--list' ]
prog = subprocess.Popen(cmdline, stdout=subprocess.PIPE, cwd=progdir)
lines = prog.stdout.readlines()
@@ -448,6 +448,7 @@ class TestHarness:
job_queue = queue.Queue()
total_count = 0
scrambled = list(jobs)
+ # TODO: What's this line doing, and what's the magic number?
scrambled.sort(key=lambda x: ("1" if x.test_count() < 30 else "0") + str(x.number))
for job in scrambled:
total_count += job.test_count()
