Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
add s4u-cloud-simple to the list of examples
[simgrid.git] / src / simix / simcalls.py
index a650164..d757d81 100755 (executable)
@@ -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)
@@ -370,9 +371,12 @@ if __name__ == '__main__':
     fd.write('#include "xbt/ex.h"\n')
     fd.write('#include <functional>\n')
     fd.write('#include <simgrid/simix.hpp>\n')
+    fd.write('#include <xbt/log.h>\n')
 
     fd.write("/** @cond */ // Please Doxygen, don't look at this\n")
     fd.write('''
+XBT_LOG_EXTERNAL_DEFAULT_CATEGORY(simix);
+
 template<class R, class... T>
 inline static R simcall(e_smx_simcall_t call, T const&... t)
 {