@Test
public void checkCustomJudgeIsExecutable() throws Exception {

  if (ExecHelper.IS_WINDOWS) {
    // All files are executable on Windows.
    return;
  }
  final File jsonFile = getShaderJobReady();
  final File emptyFile = temporaryFolder.newFile(); // Not executable
  try {
    GlslReduce.mainHelper(new String[]{
        jsonFile.getAbsolutePath(),
        "--reduction-kind",
        "CUSTOM",
        emptyFile.getAbsolutePath(),
        "--output",
        temporaryFolder.getRoot().getAbsolutePath()}, null);
    fail("An exception should have been thrown as the judge script is not executable.");
  } catch (RuntimeException exception) {
    assertTrue(exception.getMessage().contains("judge script must be executable"));
  }
}