Set up test loop