From 65cb03487d33706c590a82604800c8d22ffeb8ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20Bastian?= Date: Fri, 9 Feb 2018 00:58:09 +0100 Subject: [PATCH] March generator: enhance error handling --- tools/gen_marching_cubes_conf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/gen_marching_cubes_conf.py b/tools/gen_marching_cubes_conf.py index 8c76a14..be40cad 100644 --- a/tools/gen_marching_cubes_conf.py +++ b/tools/gen_marching_cubes_conf.py @@ -7,6 +7,7 @@ """ from functools import reduce +import sys class Vert: @@ -203,9 +204,13 @@ def do_main(base_cases): if index[code] is None: index[code] = tr_case + has_unbound = False for (val, tri) in enumerate(index): if tri is None: - print(">> UNBOUND {}".format(val)) + print(">> UNBOUND {}".format(val), file=sys.stderr) + has_unbound = True + if has_unbound: + raise RuntimeError("Some cases were not generated.") print(("static const std::vector " "edges_of_intersection[256] = {"))