capture return code from failed test