<commit_before>package systemTestingDSL

import systemTestingDSL.outputGenerator.ConsoleOutputGenerator
import systemTestingDSL.matchers.DiffMatcher
import scala.collection.mutable.ArrayBuffer
import collection.JavaConversions._
import util.control._
import com.typesafe.config.Config

class ReferenceTestRunner(configuration: Config) extends ConsoleOutputGenerator {

  private def getFileList(directory: String, extension: String): Array[String] = {
    FileSystemUtilities.getRecursiveListOfFilesWithRegex(directory, extension).map(_.getAbsolutePath())
  }

  def run(): String = {
    val refTests = configuration.getConfigList("RUN_REFERENCE_TESTS")
    val referenceRuns = ArrayBuffer[GenericTestCase]()
    var diffOutput: String = ""
    for (configuration <- refTests) {
      val files = getFileList(configuration.getString("SOURCE_DIRECTORY"), configuration.getString("SOURCE_EXTENSION"))
      val referenceDirectory = configuration.getString("REF_DIRECTORY")
      val commandName = configuration.getString("COMMAND_NAME")
      val arguments = configuration.getString("ARGUMENTS")
      //      val referenceFileExtension = configuration.getString("REF_EXTENSION")
      val referenceFileExtension = ".ref"
      for (file <- files) {
        val loop = new Breaks
        loop.breakable {
          try {

            new GenericTestCase(commandName, file, arguments, referenceDirectory,
              file.substring(file.lastIndexOf("/") + 1), ".out").run
            diffOutput += file + "\n"
            diffOutput += "*************************\n"
            diffOutput += DiffMatcher.diff(referenceDirectory + file.substring(file.lastIndexOf("/") + 1) + ".out", referenceDirectory + file.substring(file.lastIndexOf("/") + 1) + ".ref")
          } catch {
            case _: Throwable => loop.break
          }
        }
      }
    }
    println(diffOutput)
    diffOutput
  }
}
<commit_msg>Added better way to handle the exception<commit_after>package systemTestingDSL

import systemTestingDSL.outputGenerator.ConsoleOutputGenerator
import systemTestingDSL.matchers.DiffMatcher
import scala.collection.mutable.ArrayBuffer
import collection.JavaConversions._
import com.typesafe.config.Config

class ReferenceTestRunner(configuration: Config) extends ConsoleOutputGenerator {

  private def getFileList(directory: String, extension: String): Array[String] = {
    FileSystemUtilities.getRecursiveListOfFilesWithRegex(directory, extension).map(_.getAbsolutePath())
  }

  def run(): String = {
    val refTests = configuration.getConfigList("RUN_REFERENCE_TESTS")
    val referenceRuns = ArrayBuffer[GenericTestCase]()
    var diffOutput: String = ""
    for (configuration <- refTests) {
      val files = getFileList(configuration.getString("SOURCE_DIRECTORY"), configuration.getString("SOURCE_EXTENSION"))
      val referenceDirectory = configuration.getString("REF_DIRECTORY")
      val commandName = configuration.getString("COMMAND_NAME")
      val arguments = configuration.getString("ARGUMENTS")
      //      val referenceFileExtension = configuration.getString("REF_EXTENSION")
      val referenceFileExtension = ".ref"
      for (file <- files) {
        scala.util.control.Exception.ignoring(classOf[Exception]) {
          new GenericTestCase(commandName, file, arguments, referenceDirectory,
            file.substring(file.lastIndexOf("/") + 1), ".out").run
          diffOutput += file + "\n"
          diffOutput += "*************************\n"
          diffOutput += DiffMatcher.diff(referenceDirectory + file.substring(file.lastIndexOf("/") + 1) + ".out", referenceDirectory + file.substring(file.lastIndexOf("/") + 1) + ".ref")
        }
      }
    }
    println(diffOutput)
    diffOutput
  }
}

{'fraction_non_alphanumeric': 0.1203530355710083, 'fraction_numerical': 0.0016047071409467772, 'mean_word_length': 3.9081364829396326, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6269219', 'n_tokens_mistral': 972, 'n_tokens_neox': 955, 'n_words': 193}