@Test
public void testAlwaysReduceJudgeMaximallyReduces() throws Exception {

  final File jsonFile = getShaderJobReady();
  // We make this a .bat file to avoid a "what application would you like to use to open this
  // file?" pop-up on Windows.  (On other platforms the fact that it has the .bat extension does
  // not matter.)
  final File emptyFile = temporaryFolder.newFile("judge.bat");
  emptyFile.setExecutable(true);
  GlslReduce.mainHelper(new String[]{
      jsonFile.getAbsolutePath(),
      "--reduction-kind",
      "CUSTOM",
      emptyFile.getAbsolutePath(),
      "--output",
      temporaryFolder.getRoot().getAbsolutePath()}, null);
  final File[] reducedFinal = temporaryFolder.getRoot().listFiles((dir, name) -> name.contains(
      "reduced_final.frag"));
  assertEquals(1, reducedFinal.length);
  CompareAsts.assertEqualAsts("#version 100\nvoid main() { }",
      ParseHelper.parse(reducedFinal[0]));
}