create the test dir if it doesn't already exist
capture warnings in a variable if asked