X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/5ab9431deaa127bb5664f70cf66973f4d4dc494f..661e64114641721802e309fc277b081ea01078c8:/src/simix/simcalls.py diff --git a/src/simix/simcalls.py b/src/simix/simcalls.py index c25d5192f2..d757d8153c 100755 --- a/src/simix/simcalls.py +++ b/src/simix/simcalls.py @@ -8,7 +8,7 @@ import re import glob - +import sys class Arg(object): @@ -54,7 +54,7 @@ class Simcall(object): # smx_host_t h) if self.simcalls_pre is None: self.simcalls_pre = set() - for fn in glob.glob('smx_*') + glob.glob('ActorImpl*') + \ + for fn in glob.glob('smx_*') + glob.glob('../kernel/actor/ActorImpl*') + \ glob.glob('../mc/*cpp') + glob.glob('../kernel/activity/*cpp'): f = open(fn) self.simcalls_pre |= set(re.findall(r'simcall_HANDLER_(.*?)\(', f.read())) @@ -193,7 +193,8 @@ def parse(fn): continue match = re.match( r'^(\S+)\s+([^\)\(\s]+)\s*\(*(.*)\)\s*(\[\[.*\]\])?\s*;\s*?$', line) - assert match, line + if not match: + raise AssertionError(line) ret, name, args, attrs = match.groups() sargs = [] if not re.match(r"^\s*$", args): @@ -217,7 +218,7 @@ def parse(fn): elif attr == "nohandler": handler = False else: - assert False, "Unknown attribute %s in: %s" % (attr, line) + raise AssertionError("Unknown attribute %s in: %s" % (attr, line)) sim = Simcall(name, handler, Arg('result', ret), sargs, ans) if resdi is None: simcalls.append(sim) @@ -274,10 +275,9 @@ if __name__ == '__main__': ok &= all(map(Simcall.check, simcalls)) for k, v in simcalls_dict.items(): ok &= all(map(Simcall.check, v)) - # FIXME: we should not hide it - # if not ok: - # print ("Some checks fail!") - # sys.exit(1) + if not ok: + print ("Some checks fail!") + sys.exit(1) # # popping_accessors.hpp @@ -371,9 +371,12 @@ if __name__ == '__main__': fd.write('#include "xbt/ex.h"\n') fd.write('#include \n') fd.write('#include \n') + fd.write('#include \n') fd.write("/** @cond */ // Please Doxygen, don't look at this\n") fd.write(''' +XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix); + template inline static R simcall(e_smx_simcall_t call, T const&... t) {