From 372d6018759744dee6dac70fc6814c452864b7c0 Mon Sep 17 00:00:00 2001 From: Hernan Grecco Date: Mon, 4 Mar 2013 23:28:10 -0300 Subject: [PATCH] Changed test command for travis --- .travis.yml | 2 +- llvm/__init__.py | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 95f434a..f4474f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -20,5 +20,5 @@ install: - export LLVMPY_DYNLINK=1 - python setup.py install -q -script: python -c "import llvm; llvm.test()" +script: cd ~; python -c "import sys;import llvm;sys.exit(0 if llvm.test() == 0 else 1)" diff --git a/llvm/__init__.py b/llvm/__init__.py index e3e785f..8f71446 100644 --- a/llvm/__init__.py +++ b/llvm/__init__.py @@ -34,9 +34,11 @@ class LLVMException(Exception): def test(verbosity=1): """test(verbosity=1) -> TextTestResult - Run self-test, and return unittest.runner.TextTestResult object. + Run self-test, and return the number of failures + errors """ from llvm.test_llvmpy import run - return run(verbosity=verbosity) + result = run(verbosity=verbosity) + + return len(result.failures) + len(result.errors)