validate:launcher: Error out if valgrind is not available on the system

Summary:
When the user wants to use valgrind, make sure it is present on the
system before doing anything

Reviewers: gdesmott

Differential Revision: http://phabricator.freedesktop.org/D104
This commit is contained in:
Thibault Saunier 2015-04-17 19:56:17 +02:00
parent 86efbffa32
commit 76eedece5c

View file

@ -275,6 +275,14 @@ class LauncherConfig(Loggable):
self.testsuites_dir == DEFAULT_TESTSUITES_DIR:
self.testsuites_dir = os.path.join(self.main_dir, self.clone_dir,
"testsuites")
if self.valgrind:
try:
subprocess.check_output("valgrind --help", shell=True)
except subprocess.CalledProcessError:
printc("Want to use valgrind, but not avalaible on the system",
Colors.FAIL)
return False
return True
def set_http_server_dir(self, path):