Made test automatically count failures and gather statistics