aboutsummaryrefslogtreecommitdiff
path: root/meson_test.py
diff options
context:
space:
mode:
authorJussi Pakkanen <jpakkane@gmail.com>2013-09-13 00:50:45 +0300
committerJussi Pakkanen <jpakkane@gmail.com>2013-09-13 00:50:45 +0300
commitff1ac7eed1832ee81e1a9d7a71ed6856ea401a34 (patch)
tree84ac5b6f216f022e80dfb2d4211d36e21d963acc /meson_test.py
parent26bf87d1dc3e60a2b4a36d8254e3dda4e32189c5 (diff)
downloadmeson-ff1ac7eed1832ee81e1a9d7a71ed6856ea401a34.zip
meson-ff1ac7eed1832ee81e1a9d7a71ed6856ea401a34.tar.gz
meson-ff1ac7eed1832ee81e1a9d7a71ed6856ea401a34.tar.bz2
Transfer test parallelism data from source to test runner.
Diffstat (limited to 'meson_test.py')
-rwxr-xr-xmeson_test.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/meson_test.py b/meson_test.py
index 1ae4194..750c298 100755
--- a/meson_test.py
+++ b/meson_test.py
@@ -100,24 +100,21 @@ def run_tests(options, datafilename):
num_workers = int(os.environ[varname])
except ValueError:
write_log('Invalid value in %s, using 1 thread.' % varname)
+ num_workers = 1
else:
num_workers = multiprocessing.cpu_count()
executor = conc.ThreadPoolExecutor(max_workers=num_workers)
futures = []
for i, test in enumerate(tests):
- name = test[0]
- fname = test[1]
- is_cross = test[2]
- exe_runner = test[3]
- is_parallel = False
- if not is_parallel:
+ if not test.is_parallel:
drain_futures(futures)
futures = []
- f = run_single_test(wrap, fname, is_cross, exe_runner)
- print_stats(numlen, tests, name, f, i, logfile)
+ res = run_single_test(wrap, test.fname, test.is_cross, test.exe_runner)
+ print_stats(numlen, tests, test.name, res, i, logfile)
else:
- f = executor.submit(run_single_test, wrap, fname, is_cross, exe_runner)
- futures.append((f, numlen, tests, name, f, i, logfile))
+ f = executor.submit(run_single_test, wrap, test.fname,
+ test.is_cross, test.exe_runner)
+ futures.append((f, numlen, tests, test.name, f, i, logfile))
drain_futures(futures)
print('\nFull log written to %s.' % logfilename)