From b6dcecb4bf008b8327487a4b43efc2a9c9f9a622 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 4 Jun 2012 16:13:34 +0200 Subject: [PATCH 1/2] Set proper exit code when running tests --- test/run.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/run.py b/test/run.py index e64c1db1..c61b2767 100755 --- a/test/run.py +++ b/test/run.py @@ -10,7 +10,6 @@ import functions #functions.set_debug_function(functions.debug.print_to_stdout) - def completion_test(source): """ This is the completion test for some cases. The tests are not unit test @@ -63,6 +62,7 @@ def completion_test(source): # completion tests: completion_test_dir = 'completion' summary = [] +tests_pass = True for f_name in os.listdir(completion_test_dir): if len(sys.argv) == 1 or [a for a in sys.argv[1:] if a in f_name]: if f_name.endswith(".py"): @@ -70,9 +70,13 @@ for f_name in os.listdir(completion_test_dir): f = open(path) num_tests, fails = completion_test(f.read()) s = 'run %s tests with %s fails (%s)' % (num_tests, fails, f_name) + if fails: + tests_pass = False print s summary.append(s) print '\nSummary:' for s in summary: print s +exit_code = 0 if tests_pass else 1 +sys.exit(exit_code) From 043e5307023a5c1a0ef00bac06e87d9019497ae4 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 4 Jun 2012 16:15:10 +0200 Subject: [PATCH 2/2] Travis config file --- .travis.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..af66c914 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,11 @@ +language: python +python: + - 2.5 + - 2.6 + - 2.7 + - 3.2 + - pypy +install: echo "No external requirements" +script: + - cd test + - python run.py