def METHOD_NAME(project, logger, reactor):
    logger.info("Running Cram command line tests")
    cram_tests = list(_find_files(project))
    if not cram_tests or len(cram_tests) == 0:
        if project.get_property("cram_fail_if_no_tests"):
            raise BuildFailedException("No Cram tests found!")
        else:
            return
    pyb_venv = reactor.pybuilder_venv
    command_and_arguments = pyb_venv.executable + _cram_command_for(project)
    command_and_arguments.extend(cram_tests)
    report_file = _report_file(project)
    pyb_environ = pyb_venv.environ
    if project.get_property("cram_run_test_from_target"):
        dist_dir = project.expand_path("$dir_dist")
        _prepend_path(pyb_environ, "PYTHONPATH", dist_dir)
        script_dir_dist = project.get_property("dir_dist_scripts")
        _prepend_path(pyb_environ, "PATH", os.path.join(dist_dir, script_dir_dist))
    else:
        source_dir = project.expand_path("$dir_source_main_python")
        _prepend_path(pyb_environ, "PYTHONPATH", source_dir)
        script_dir = project.expand_path("$dir_source_main_scripts")
        _prepend_path(pyb_environ, "PATH", script_dir)
    return_code = pyb_venv.execute_command(command_and_arguments,
                                           report_file,
                                           env=pyb_environ,
                                           error_file_name=report_file)
    if return_code != 0:
        error_str = "Cram tests failed! See %s for full details:\n%s" % (report_file, tail_log(report_file))
        logger.error(error_str)
        raise BuildFailedException(error_str)
    report = read_file(report_file)
    result = report[-1][2:].strip()
    logger.info("Cram tests were fine")
    logger.info(result)