public void testOutputFormat() {
   ByteArrayOutputStream output = new ByteArrayOutputStream();
   PrintStream outstream = new PrintStream(output);
   PerformanceTracker tracker = new PerformanceTracker(emptyScript, TracerMode.ALL, outstream);
   tracker.outputTracerReport();
   outstream.close();
   Pattern p =
       Pattern.compile(
           ".*Summary:\npass,runtime,allocMem,runs,changingRuns,reduction,gzReduction"
               + ".*TOTAL:"
               + "\nRuntime\\(ms\\): [0-9]+"
               + "\nMax mem usage \\(measured after each pass\\)\\(MB\\): -?[0-9]+"
               + "\n#Runs: [0-9]+"
               + "\n#Changing runs: [0-9]+"
               + "\n#Loopable runs: [0-9]+"
               + "\n#Changing loopable runs: [0-9]+"
               + "\nEstimated Reduction\\(bytes\\): [0-9]+"
               + "\nEstimated GzReduction\\(bytes\\): [0-9]+"
               + "\nEstimated Size\\(bytes\\): -?[0-9]+"
               + "\nEstimated GzSize\\(bytes\\): -?[0-9]+"
               + "\n\nLog:\n"
               + "pass,runtime,allocMem,codeChanged,reduction,gzReduction,size,gzSize.*",
           Pattern.DOTALL);
   String outputString = output.toString();
   assertThat(outputString).matches(p);
 }