Return error code from tests (#137)