summary refs log tree commit diff stats
path: root/tools/ci_testresults.nim
diff options
context:
space:
mode:
authordeansher <deansherthompson@gmail.com>2019-01-29 05:34:09 -0500
committerdeansher <deansherthompson@gmail.com>2019-01-29 05:34:09 -0500
commitc2e6fc0dfbc7dd06fa6adb893f93a1fdd7932a73 (patch)
tree082c7344176df25e225c0e1f9c97bbb1a1314246 /tools/ci_testresults.nim
parentd60f8ab99181ea18cc534728ba4d0470c0ca1bce (diff)
parenta58f5b6023744da9f44e6ab8b1c748002b2bbcc0 (diff)
downloadNim-c2e6fc0dfbc7dd06fa6adb893f93a1fdd7932a73.tar.gz
Merge remote-tracking branch 'upstream/devel' into devel
Diffstat (limited to 'tools/ci_testresults.nim')
-rw-r--r--tools/ci_testresults.nim24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/ci_testresults.nim b/tools/ci_testresults.nim
new file mode 100644
index 000000000..3201606d7
--- /dev/null
+++ b/tools/ci_testresults.nim
@@ -0,0 +1,24 @@
+## Print summary of failed tests for CI
+
+import os, json, sets, strformat
+
+const skip = toSet(["reDisabled", "reIgnored", "reSuccess", "reJoined"])
+
+when isMainModule:
+  for fn in walkFiles("testresults/*.json"):
+    let entries = fn.readFile().parseJson()
+    for j in entries:
+      let res = j["result"].getStr()
+      if skip.contains(res):
+        continue
+      echo fmt """
+Category: {j["category"].getStr()}
+Name: {j["name"].getStr()}
+Action: {j["action"].getStr()}
+Result: {res}
+-------- Expected -------
+{j["expected"].getStr()}
+--------- Given  --------
+{j["given"].getStr()}
+-------------------------
+"""