Return error code on test failure