Create the output_dir for the test subcommand.

This change creates the output directory for the test subcommand if it
does not yet exist. If it exists, use it. Any other exceptions are
re-raised.

Change-Id: I487c69e70f9b6c475691ca4fef4669a0c318ab55