From ef443c2bd7e8e5581d6634a6a14b803b21e520ae Mon Sep 17 00:00:00 2001 From: Daniel Narvaez Date: Fri, 28 Dec 2012 20:03:18 +0000 Subject: Move all checks into python code So that they can be logged. --- (limited to 'devbot/check.py') diff --git a/devbot/check.py b/devbot/check.py new file mode 100644 index 0000000..aca4fed --- /dev/null +++ b/devbot/check.py @@ -0,0 +1,47 @@ +import os +import subprocess + +from devbot import config +from devbot import command +from devbot import xvfb +from devbot import build + + +def check_one(module_name): + for module in config.load_modules(): + if module.name == module_name: + return _check_module(module) + + return False + + +def check(): + if not build.build(): + return False + + modules = config.load_modules() + for module in modules: + if not _check_module(module): + return False + + return True + + +def _check_module(module): + result = True + + if module.has_checks: + print "* Checking %s" % module.name + + os.chdir(module.get_build_dir()) + + xvfb_proc, orig_display = xvfb.start() + + try: + command.run(["make", "check"]) + except subprocess.CalledProcessError: + result = False + + xvfb.stop(xvfb_proc, orig_display) + + return result -- cgit v0.9.1