diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2018-02-18 13:54:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-02-18 13:54:50 +0200 |
commit | 55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2 (patch) | |
tree | 29e6686ece50f119e8a4e850653c221b6872b975 /run_unittests.py | |
parent | 1841d53a84be13a3ba989b917930b824aafdac26 (diff) | |
parent | 7297e9f7a3581d132b0bccc47da4435c7315c74b (diff) | |
download | meson-55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2.zip meson-55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2.tar.gz meson-55a7c265c11e0f3e8a94cf9f4fd0b5f036a717d2.tar.bz2 |
Merge pull request #2863 from jon-turney/exit-status-on-exception
Verify that failing tests are failing with an error, not a python exception
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/run_unittests.py b/run_unittests.py index 103847a..69f467b 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -1933,6 +1933,17 @@ class FailureTests(BasePlatformTests): self.assertRegex(out, r'Also couldn\'t find a fallback subproject in ' '.*subprojects.*failingsubproj.*for the dependency.*somedep') + def test_exception_exit_status(self): + ''' + Test exit status on python exception + ''' + tdir = os.path.join(self.unit_test_dir, '21 exit status') + os.environ['MESON_UNIT_TEST'] = '1' + with self.assertRaises(subprocess.CalledProcessError) as cm: + self.init(tdir, inprocess=False) + self.assertEqual(cm.exception.returncode, 2) + self.wipe() + class WindowsTests(BasePlatformTests): ''' |