def run_cov_with_arg(self, args): MANAGER = cov_manager.CovManager() with MANAGER.temp_manager(): c = cov_config.ConfigNamespace() cov_mod.parse_args(args, namespace=c) inference_extension.enable() klara.initialize(c) c.output_file = self.result cov_mod.run(c) return self.result.getvalue()
def init_solver(self, **kwargs): prm_data.append(ET.parse(self.sample_data_xml.open())) config = self.setup_cov_config(py_version=3, analyze_procedure=True, entry_class="MyClass", entry_func="Top", enable_infer_sequence=True, overwrite=True, **kwargs) inference_extension.enable() return config
def initialize(config: Config = None, smt_disable: bool = False) -> None: """initialize klara to a different configuration :param config: a config object of type Klara.Config to fine tune configuration :param smt_disable: disable z3 solver support :return: None """ if smt_disable: manager = _core_manager.AstManager() manager.initialize(config or Config()) _infer_extension.disable() else: MANAGER.initialize(config or Config()) _infer_extension.enable()
def setUpClass(cls) -> None: config = ContractConfig() MANAGER.initialize(config) inference_extension.enable()
def main(): c = ConfigNamespace() parse_args(sys.argv[1:], namespace=c) MANAGER.initialize(c) inference_extension.enable() run(c)