Mentions légales du service

Skip to content
Snippets Groups Projects
Commit d8fd9e50 authored by Kevin Pouget's avatar Kevin Pouget
Browse files

reognize

parent b83d7630
No related branches found
No related tags found
No related merge requests found
......@@ -39,7 +39,7 @@ def all_subpackages(pkg_prefix, verbose, what_to_run, parent, prefix=""):
run_module(verbose, modname, mod, getattr(mod, what))
except Exception as e:
log.warn("{} failed {}".format(modname, e))
#traceback.print_exc()
traceback.print_exc()
def main(pkg_prefix, module=None, benchmark=True, test=True, verbose=False, help=False):
what_to_run = []
......@@ -90,7 +90,7 @@ class CSource:
def package(self, package):
self._package = package if hasattr(package, "__path__") else \
importlib.import_module(package.__package__)
self.src_dir = "{pkgpath}/{path}".format(pkgpath=self.package.__path__[0],
path=self.path)
self.target_dir = "{}/__binaries__/".format(self.src_dir)
......@@ -193,7 +193,7 @@ class GDB_Instance:
source.package = self.package
source.compile()
command_line = "gdb -nx"
command_line = "/usr/bin/gdb -nx"
self._gdb = subprocess.Popen(shlex.split(command_line),
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
......
from gdb_tester import *
from gdb_tester import CSource
gdb = None
......@@ -123,18 +123,18 @@ end
return exec_time
def benchmark(_gdb, what=None, no_mcgdb=True):
def benchmark(_gdb, what=None, at_init=None):
global gdb
gdb = _gdb
# if what is None:
# what = [nominal_time, gdb_breakpoint, gdb_watchpoint] + \
# list(map(lambda x: gdb_py_breakpoint_parameter(x), (0b0, 0b1, 0b10, 0b11)))
what = [do_nothing, set_breakpoints]
gdb.start(CSource("benchmark.c"), None if no_mcgdb else mcgdb.testing.gdb__init_mcgdb)
# what = [do_nothing, set_breakpoints]
if what is None:
what = [do_nothing, set_breakpoints, nominal_time, gdb_breakpoint, gdb_watchpoint] + \
list(map(lambda x: gdb_py_breakpoint_parameter(x), (0b0, 0b1, 0b10, 0b11)))
gdb.start(CSource("../mcgdb_testing/benchmark.c"), at_init)
for prepare_and_run in what:
prepare_and_run()
gdb.reset(hard=(not no_mcgdb))
gdb.reset(hard=(not at_init))
gdb.quit()
......@@ -32,8 +32,9 @@ def prepare(_gdb):
def benchmark(_gdb):
global native_gdb, gdb
from . import native_gdb
from ..gdb_testing import native_gdb
import mcgdb.testing
gdb = _gdb
what = [function_breakpoint, finish_breakpoint]
native_gdb.benchmark(_gdb, what, no_mcgdb=False)
native_gdb.benchmark(_gdb, what, mcgdb.testing.gdb__init_mcgdb)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment