diff options
author | Jussi Pakkanen <jpakkane@gmail.com> | 2020-07-11 21:00:45 +0300 |
---|---|---|
committer | Jussi Pakkanen <jpakkane@gmail.com> | 2020-07-12 00:07:26 +0300 |
commit | fa929b47148cfb19877a25ab128686ca4ae0208f (patch) | |
tree | 11387cc8bdfbd2cc7231a85e48d92145ea32fe26 /run_unittests.py | |
parent | 4c9d57200acc8f46456653393f444dfd503f33e1 (diff) | |
download | meson-fa929b47148cfb19877a25ab128686ca4ae0208f.zip meson-fa929b47148cfb19877a25ab128686ca4ae0208f.tar.gz meson-fa929b47148cfb19877a25ab128686ca4ae0208f.tar.bz2 |
Check that hg is actually working.
Diffstat (limited to 'run_unittests.py')
-rwxr-xr-x | run_unittests.py | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/run_unittests.py b/run_unittests.py index 5fd790c..820b705 100755 --- a/run_unittests.py +++ b/run_unittests.py @@ -2834,9 +2834,25 @@ class AllPlatformTests(BasePlatformTests): # fails sometimes. pass - def test_dist_hg(self): + def has_working_hg(self): if not shutil.which('hg'): - raise unittest.SkipTest('Mercurial not found') + return False + try: + # This check should not be necessary, but + # CI under macOS passes the above test even + # though Mercurial is not installed. + if subprocess.call(['hg', '--version'], + stdout=subprocess.DEVNULL, + stderr=subprocess.DEVNULL) != 0: + return False + return True + except FileNotFoundError: + return False + + + def test_dist_hg(self): + if not self.has_working_hg(): + raise unittest.SkipTest('Mercurial not found or broken.') if self.backend is not Backend.ninja: raise unittest.SkipTest('Dist is only supported with Ninja') |