<commit_before># vim: set sw=2 ts=2 softtabstop=2 expandtab:
from . RunnerBase import RunnerBaseClass
import logging
import os
import re
import psutil
import yaml

_logger = logging.getLogger(__name__)

class KleeRunnerException(Exception):
  def __init__(self, msg):
    self.msg = msg

class KleeRunner(RunnerBaseClass):
  fuzzTime = 5 # Allow additional time before aggressively killing KLEE.

  def __init__(self, invocationInfo, workingDirectory, rc):
    _logger.debug('Initialising {}'.format(invocationInfo.Program))

    # FIXME: We should have a schema for this so we don't have to write this
    if 'max_time' in rc:
      raise KleeRunnerException("'max_time' should not be specified use 'explore_max_time' and 'generate_tests_max_time' instead")

    self.exploreMaxTime = 0
    self.generateTestsMaxTime = 0
    if not 'explore_max_time' in rc:
      raise KleeRunnerException("'explore_max_time' must be specified")
    self.exploreMaxTime = rc['explore_max_time']
    if not isinstance(self.exploreMaxTime, int):
      raise KleeRunnerException("'explore_max_time' must be an integer")
    if self.exploreMaxTime < 0:
      raise KleeRunnerException("'explore_max_time' must be >= 0")

    if not 'generate_tests_max_time' in rc:
      raise KleeRunnerException("'generate_tests_max_time' must be specified")
    self.generateTestsMaxTime = rc['generate_tests_max_time']
    if not isinstance(self.generateTestsMaxTime, int):
      raise KleeRunnerException("'generate_tests_max_time' must be an integer")
    if self.generateTestsMaxTime < 0:
      raise KleeRunnerException("'generate_tests_max_time' must be >= 0")

    # Derive max time from the specified times
    assert self.fuzzTime >= 0
    maxTime = self.exploreMaxTime + self.generateTestsMaxTime + self.fuzzTime
    rc['max_time'] = maxTime
    _logger.info('Forcing max_time to be {} seconds'.format(rc['max_time']))
<commit_msg>Remove fuzz time from `Klee` runner. There isn't a good reason to have it. The user should just have suitable values for `explore_max_time` and `generate_tests_max_time`.<commit_after># vim: set sw=2 ts=2 softtabstop=2 expandtab:
from . RunnerBase import RunnerBaseClass
import logging
import os
import re
import psutil
import yaml

_logger = logging.getLogger(__name__)

class KleeRunnerException(Exception):
  def __init__(self, msg):
    self.msg = msg

class KleeRunner(RunnerBaseClass):
  def __init__(self, invocationInfo, workingDirectory, rc):
    _logger.debug('Initialising {}'.format(invocationInfo.Program))

    # FIXME: We should have a schema for this so we don't have to write this
    if 'max_time' in rc:
      raise KleeRunnerException("'max_time' should not be specified use 'explore_max_time' and 'generate_tests_max_time' instead")

    self.exploreMaxTime = 0
    self.generateTestsMaxTime = 0
    if not 'explore_max_time' in rc:
      raise KleeRunnerException("'explore_max_time' must be specified")
    self.exploreMaxTime = rc['explore_max_time']
    if not isinstance(self.exploreMaxTime, int):
      raise KleeRunnerException("'explore_max_time' must be an integer")
    if self.exploreMaxTime < 0:
      raise KleeRunnerException("'explore_max_time' must be >= 0")

    if not 'generate_tests_max_time' in rc:
      raise KleeRunnerException("'generate_tests_max_time' must be specified")
    self.generateTestsMaxTime = rc['generate_tests_max_time']
    if not isinstance(self.generateTestsMaxTime, int):
      raise KleeRunnerException("'generate_tests_max_time' must be an integer")
    if self.generateTestsMaxTime < 0:
      raise KleeRunnerException("'generate_tests_max_time' must be >= 0")

    # Derive max time from the specified times
    maxTime = self.exploreMaxTime + self.generateTestsMaxTime
    assert maxTime >= 0
    rc['max_time'] = maxTime
    _logger.info('Forcing max_time to be {} seconds'.format(rc['max_time']))

{'fraction_non_alphanumeric': 0.08821253546556616, 'fraction_numerical': 0.0054165591952540625, 'mean_word_length': 4.677891654465593, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, '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': '3797362', 'n_tokens_mistral': 1206, 'n_tokens_neox': 1175, 'n_words': 340}