aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYeongjin Jeong <yeongjin.jeong@navercorp.com>2019-02-08 17:01:37 +0900
committerJussi Pakkanen <jpakkane@gmail.com>2019-02-09 00:32:01 +0200
commita75bda7154c043994323d54acf16e7c4665eb1a7 (patch)
tree03a854cd1f2fbc6e5b9c0ca6bf5641b2dff1fa07
parent711f73e3862e6d1ef96b5c5c6e8d27231c9eca9c (diff)
downloadmeson-a75bda7154c043994323d54acf16e7c4665eb1a7.zip
meson-a75bda7154c043994323d54acf16e7c4665eb1a7.tar.gz
meson-a75bda7154c043994323d54acf16e7c4665eb1a7.tar.bz2
mtest: Don't use thread executor when enabled gdb in test_setup
If the global gdb option of mesontest is disabled (e.g. not set '--gdb') and the gdb option of test_setup is enabled, an exception will be thrown. Because signal.signal function can only be called from the main thread. If attempting to call it from other threads will cause a ValueError exception to be raised.
-rw-r--r--mesonbuild/mtest.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py
index b4bd4f2..6536558 100644
--- a/mesonbuild/mtest.py
+++ b/mesonbuild/mtest.py
@@ -438,6 +438,8 @@ class TestHarness:
current = self.build_data.test_setups[full_name]
if not options.gdb:
options.gdb = current.gdb
+ if options.gdb:
+ options.verbose = True
if options.timeout_multiplier is None:
options.timeout_multiplier = current.timeout_multiplier
# if options.env is None:
@@ -693,18 +695,17 @@ Timeout: %4d
for _ in range(self.options.repeat):
for i, test in enumerate(tests):
visible_name = self.get_pretty_suite(test)
+ single_test = self.get_test_runner(test)
- if not test.is_parallel or self.options.gdb:
+ if not test.is_parallel or single_test.options.gdb:
self.drain_futures(futures)
futures = []
- single_test = self.get_test_runner(test)
res = single_test.run()
self.process_test_result(res)
self.print_stats(numlen, tests, visible_name, res, i)
else:
if not executor:
executor = conc.ThreadPoolExecutor(max_workers=self.options.num_processes)
- single_test = self.get_test_runner(test)
f = executor.submit(single_test.run)
futures.append((f, numlen, tests, visible_name, i))
if self.options.repeat > 1 and self.fail_count: