diff options
author | wbond <will@wbond.net> | 2015-11-04 23:47:34 -0500 |
---|---|---|
committer | wbond <will@wbond.net> | 2015-11-05 02:15:36 -0500 |
commit | 801ce8636654d8efab71b079c46765e66e0359f1 (patch) | |
tree | 2e58c2250b2a0633c43f52ce69e8e5e86e5266fc /run.py | |
parent | 277d76d3699ca93084c3e25965b6a7dd965e68ea (diff) | |
download | asn1crypto-801ce8636654d8efab71b079c46765e66e0359f1.tar.gz |
Add "ci" task and Travis CI config
Diffstat (limited to 'run.py')
-rw-r--r-- | run.py | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -11,7 +11,7 @@ else: def show_usage(): - print('Usage: run.py (lint | tests [regex] | coverage)', file=sys.stderr) + print('Usage: run.py (lint | tests [regex] | coverage | ci)', file=sys.stderr) sys.exit(1) @@ -29,7 +29,7 @@ if len(sys.argv) < 2 or len(sys.argv) > 3: task = get_arg(1) -if task not in ('lint', 'tests', 'coverage'): +if task not in set(['lint', 'tests', 'coverage', 'ci']): show_usage() if task != 'tests' and len(sys.argv) == 3: @@ -48,4 +48,18 @@ elif task == 'tests': elif task == 'coverage': from dev.coverage import run -run(*params) +elif task == 'ci': + from dev.tests import run as run_tests + from dev.lint import run as run_lint + + def run(): + print('Python ' + sys.version.replace('\n', '')) + print('') + lint_result = run_lint() + print('\nRunning tests') + tests_result = run_tests() + + return lint_result and tests_result + +result = run(*params) +sys.exit(int(not result)) |