diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2019-05-01 10:04:50 +1000 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2019-05-02 22:12:58 +0300 |
commit | 70997ca969dab0de7a800af7f7c7d6c7e25cf4ac (patch) | |
tree | a3b6d99197344231afe8f29fe9e29c7b6362306e /mesonbuild | |
parent | ec757492bfa5431952ea2e4274368393885a3639 (diff) | |
download | meson-70997ca969dab0de7a800af7f7c7d6c7e25cf4ac.zip meson-70997ca969dab0de7a800af7f7c7d6c7e25cf4ac.tar.gz meson-70997ca969dab0de7a800af7f7c7d6c7e25cf4ac.tar.bz2 |
mtest: check for an empty suite list
For consistency, it can be useful to have an explicit empty test suite list
for a test:
test('test-name', binary, suite: [])
This currently passes meson but fails when running meson tests:
Traceback (most recent call last):
File "/usr/lib/python3.7/site-packages/mesonbuild/mesonmain.py", line 122, in run
return options.run_func(options)
File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 1005, in run
return th.doit()
File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 756, in doit
self.run_tests(tests)
File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 896, in run_tests
visible_name = self.get_pretty_suite(test)
File "/usr/lib/python3.7/site-packages/mesonbuild/mtest.py", line 875, in get_pretty_suite
rv = TestHarness.split_suite_string(test.suite[0])[0]
IndexError: list index out of range
Fix it by simply checking for the test suite to be a valid list we can pass on
Fixes #5340
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'mesonbuild')
-rw-r--r-- | mesonbuild/mtest.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mtest.py b/mesonbuild/mtest.py index 17af4df..8df8f48 100644 --- a/mesonbuild/mtest.py +++ b/mesonbuild/mtest.py @@ -873,7 +873,7 @@ Timeout: %4d return wrap def get_pretty_suite(self, test): - if len(self.suites) > 1: + if len(self.suites) > 1 and test.suite: rv = TestHarness.split_suite_string(test.suite[0])[0] s = "+".join(TestHarness.split_suite_string(s)[1] for s in test.suite) if len(s): |