Returns success code depending on passing tests