aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-03 09:08:24 -0700
committerGravatar Nikolaus Rath <Nikolaus@rath.org>2016-10-03 09:08:58 -0700
commit321af37ee17ca1c821b33efa285ba67e794bc4d5 (patch)
tree32e6c3b3cb3d6d6eff8dc9a1e539f8d77e141129 /test
parentf270ba91215c3f14b1f44da0e5db0221226a5715 (diff)
Don't crash if valgrind or libtool are not installed.
Diffstat (limited to 'test')
-rw-r--r--test/util.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/test/util.py b/test/util.py
index 5f2f3e0..e8bb9c2 100644
--- a/test/util.py
+++ b/test/util.py
@@ -40,9 +40,13 @@ def umount(mount_process, mnt_dir):
# If valgrind and libtool are available, use them
def has_program(name):
- return subprocess.call([name, '--version'],
- stdout=subprocess.DEVNULL,
- stderr=subprocess.DEVNULL) == 0
+ try:
+ ret = subprocess.call([name, '--version'],
+ stdout=subprocess.DEVNULL,
+ stderr=subprocess.DEVNULL)
+ except FileNotFoundError:
+ return False
+ return ret == 0
if has_program('valgrind') and has_program('libtool'):
base_cmdline = [ 'libtool', '--mode=execute',