Return exit code when running tests.

The exit code is needed by Travis so we can tell if the tests were successful
or not.
Merge pull request #1008 from beav/retcode

Return exit code when running tests.