From 5f1f23f1efb139ec3f559fcb72908d538bb2ae67 Mon Sep 17 00:00:00 2001
From: Dominic Kempf <dominic.kempf@iwr.uni-heidelberg.de>
Date: Tue, 18 Oct 2016 13:15:20 +0200
Subject: [PATCH] [bugfix] Have test fail if l2 error is nan or -inf

---
 python/dune/perftool/pdelab/driver.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/python/dune/perftool/pdelab/driver.py b/python/dune/perftool/pdelab/driver.py
index d0b40363..303425bc 100644
--- a/python/dune/perftool/pdelab/driver.py
+++ b/python/dune/perftool/pdelab/driver.py
@@ -1293,7 +1293,7 @@ def compare_L2_squared():
     accum_error = name_accumulated_L2_error()
     fail = name_test_fail_variable()
     return ["std::cout << \"l2errorsquared: \" << {} << std::endl;".format(accum_error),
-            "if ({}>{})".format(accum_error, get_option("compare_l2errorsquared")),
+            "if (std::isnan({0}) or std::abs({0})>{1})".format(accum_error, get_option("compare_l2errorsquared")),
             "  {} = true;".format(fail)]
 
 
-- 
GitLab