Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/devbot/check.py
diff options
context:
space:
mode:
authorDaniel Narvaez <dwnarvaez@gmail.com>2012-12-28 20:03:18 (GMT)
committer Daniel Narvaez <dwnarvaez@gmail.com>2012-12-28 20:03:18 (GMT)
commitef443c2bd7e8e5581d6634a6a14b803b21e520ae (patch)
tree8ad01a7de2cc87826759875a4c1e196118b8e3b6 /devbot/check.py
parentc9476f1837246cfe59c7a8e262e404def7c6f533 (diff)
Move all checks into python code
So that they can be logged.
Diffstat (limited to 'devbot/check.py')
-rw-r--r--devbot/check.py47
1 files changed, 47 insertions, 0 deletions
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