From 06b9baee67b8e94cf958d9495ef3941fa39a7ef7 Mon Sep 17 00:00:00 2001
From: Oliver Sander <oliver.sander@tu-dresden.de>
Date: Thu, 5 May 2016 22:06:07 +0200
Subject: [PATCH] Rewrite the testsuite in Python

Having it in bash was starting to be a pain.  This particular testsuite uses
a bit of arithmetic, which was difficult to do in bash, but trivial in Python.
---
 .../testsuite.py                              | 36 +++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100644 harmonicmaps-skyrmions-eoc-testsuite/testsuite.py

diff --git a/harmonicmaps-skyrmions-eoc-testsuite/testsuite.py b/harmonicmaps-skyrmions-eoc-testsuite/testsuite.py
new file mode 100644
index 00000000..0b186e6e
--- /dev/null
+++ b/harmonicmaps-skyrmions-eoc-testsuite/testsuite.py
@@ -0,0 +1,36 @@
+import subprocess
+
+for order in range(1,4):
+
+    minLevel =  5 + 1 - order;
+    maxLevel = 10 + 1 - order;
+
+    processList = []
+
+    for numLevels in range(minLevel,maxLevel+1):
+        subprocess.call(["echo", "foo"])
+
+        LOGFILE = "./harmonicmaps_" + str(order) + "_" + str(numLevels) + ".log"
+
+        ##  run the actual simulation
+        executable = "./harmonicmaps-" + str(order)
+        p = subprocess.Popen([executable, "harmonicmaps-skyrmions-hexagon.parset", "-numLevels", str(numLevels)])
+        processList.append(p)
+
+    exit_codes = [p.wait() for p in processList]
+
+    subprocess.call(["echo", "Now measuring errors"])
+
+
+    for numLevels in range(minLevel,maxLevel+1):
+        # Measure the discretization errors against the solution on the finest grid
+        LOGFILE = "./compute-disc-error_" + str(order) + "_" + str(numLevels) + ".log"
+
+        subprocess.Popen(["../build-cmake/src/compute-disc-error", "compute-disc-error-skyrmions-hexagon.parset",
+                                        "-order", str(order),
+                                        "-numLevels", str(numLevels),
+                                        "-numReferenceLevels", str(maxLevel),
+                                        "-simulationData", "harmonicmaps-result-" + str(order) + "-" + str(numLevels) + ".data",
+                                        "-referenceData", "harmonicmaps-result-" + str(order) + "-" + str(maxLevel) + ".data"])
+
+
-- 
GitLab