jeamland/behave — pull request #49 by noelbush (2012-05-29 13:20:38+00:00)
Title: more useful exit value

When running Behave inside some other environment (for instance, from Jenkins via a shell script, as we are), it is useful for the exit value of the process to be something more than just 0 for success or 1 for failure. This tiny patch causes "behave" to exit with the sum of failed steps + undefined steps, which is (for us) the most useful measure of whether or not the tests are "green".

If all tests pass, then the return value is still 0. And failure is non-zero. I guess the only change for some people would be that undefined tests will cause a non-zero return value.

Maybe it would be worth making this more configurable (let the user decide which statuses of which types of items are included in the exit value), but this is a start, and it would be good to know if you feel this makes sense and is worth pursuing.