summary refs log tree commit diff stats
path: root/testament/backend.nim
diff options
context:
space:
mode:
authorArne Döring <arne.doering@gmx.net>2018-11-28 11:42:44 +0100
committerAraq <rumpf_a@web.de>2018-12-11 21:23:19 +0100
commita22bf14bb6614d763a50e8fd2dba4a7d7d48c9c1 (patch)
tree4f039eceb38909e9cc8ca8380d2656cbb9ee1a8c /testament/backend.nim
parentdec863a85a8bc7ffeaec5ed55e36394b9392016c (diff)
downloadNim-a22bf14bb6614d763a50e8fd2dba4a7d7d48c9c1.tar.gz
fix htmlgen, that I broke
Diffstat (limited to 'testament/backend.nim')
-rw-r--r--testament/backend.nim17
1 files changed, 7 insertions, 10 deletions
diff --git a/testament/backend.nim b/testament/backend.nim
index a1de5859a..c2658d6a0 100644
--- a/testament/backend.nim
+++ b/testament/backend.nim
@@ -20,14 +20,11 @@ var
   thisCommit: CommitId
   thisBranch: string
 
-{.experimental.}
-proc `()`(cmd: string{lit}): string = cmd.execProcess.string.strip
-
 proc getMachine*(): MachineId =
-  var name = "hostname"()
+  var name = execProcess("hostname").string.strip
   if name.len == 0:
-    name = when defined(posix): getenv"HOSTNAME".string
-           else: getenv"COMPUTERNAME".string
+    name = when defined(posix): getenv("HOSTNAME").string
+           else: getenv("COMPUTERNAME").string
   if name.len == 0:
     quit "cannot determine the machine name"
 
@@ -35,8 +32,8 @@ proc getMachine*(): MachineId =
 
 proc getCommit(): CommitId =
   const commLen = "commit ".len
-  let hash = "git log -n 1"()[commLen..commLen+10]
-  thisBranch = "git symbolic-ref --short HEAD"()
+  let hash = execProcess("git log -n 1").string.strip[commLen..commLen+10]
+  thisBranch = execProcess("git symbolic-ref --short HEAD").string.strip
   if hash.len == 0 or thisBranch.len == 0: quit "cannot determine git HEAD"
   result = CommitId(hash)
 
@@ -45,7 +42,7 @@ var
   currentCategory: string
   entries: int
 
-proc writeTestResult*(name, category, target, result, expected, given: string) =
+proc writeTestResult*(name, category, target, action, result, expected, given: string) =
   createDir("testresults")
   if currentCategory != category:
     if currentCategory.len > 0:
@@ -57,7 +54,7 @@ proc writeTestResult*(name, category, target, result, expected, given: string) =
     entries = 0
 
   let jentry = %*{"name": name, "category": category, "target": target,
-    "result": result, "expected": expected, "given": given,
+    "action": action, "result": result, "expected": expected, "given": given,
     "machine": thisMachine.string, "commit": thisCommit.string, "branch": thisBranch}
   if entries > 0:
     results.writeLine(",")