return error code if tests fail