Add functions to dump test data and count errors