private boolean runTestCase(File dir) throws IOException {
    File xmlDir = new File(dir, toDir);
    File compactDir = new File(dir, COMPACT_DIR);
    File outputDir = new File(dir, OUT_DIR);
    File correct = new File(compactDir, CORRECT_SCHEMA_NAME + COMPACT_EXTENSION);
    File incorrect = new File(compactDir, INCORRECT_SCHEMA_NAME + COMPACT_EXTENSION);
    boolean passed = true;
    if (correct.exists()) {
      File output = new File(outputDir, CORRECT_SCHEMA_NAME + toExt);
      if (!run(correct, output, outputFormat, toExt)
          || !compareDir(xmlDir, outputDir)) {
        passed = false;
        failed(correct);
      }
      else if (toExt.equals(XML_EXTENSION)) {
        cleanDir(outputDir);
        File output2 = new File(outputDir, CORRECT_SCHEMA_NAME + COMPACT_EXTENSION);
        if (!run(correct, output2, compactOutputFormat, COMPACT_EXTENSION)
            || !run(output2, output, outputFormat, toExt)
            || !compareDir(xmlDir, outputDir)) {
          passed = false;
          failed(correct);
        }
      }
    }
    if (incorrect.exists()) {
      File output = new File(outputDir, INCORRECT_SCHEMA_NAME + toExt);
      if (run(incorrect, output, outputFormat, toExt)) {
        passed = false;
        failed(incorrect);
      }
    }
    return passed;
  }