summary refs log tree commit diff stats
path: root/tests
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-01-14 01:28:52 +0100
committerAraq <rumpf_a@web.de>2014-01-14 01:28:52 +0100
commita1713bc2f95ddfa6b042315196607f7d5a01d135 (patch)
treeb5591f176bf07ad02baee18d003df9b2443b80de /tests
parentc648a5774abc44f14d3fca8bc7e81b60b1d96b46 (diff)
downloadNim-a1713bc2f95ddfa6b042315196607f7d5a01d135.tar.gz
tester: htmlgen almost works
Diffstat (limited to 'tests')
-rw-r--r--tests/testament/htmlgen.nim16
1 files changed, 14 insertions, 2 deletions
diff --git a/tests/testament/htmlgen.nim b/tests/testament/htmlgen.nim
index 6e3865bab..4abcacbd4 100644
--- a/tests/testament/htmlgen.nim
+++ b/tests/testament/htmlgen.nim
@@ -71,6 +71,16 @@ div.tabContent.hide { display: none; }
         i++;
       }
     }
+
+    function getFirstChildWithTagName( element, tagName ) {
+      for ( var i = 0; i < element.childNodes.length; i++ ) {
+        if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
+      }
+    }
+    function getHash( url ) {
+      var hashPos = url.lastIndexOf ( '#' );
+      return url.substring( hashPos + 1 );
+    }
     </script>
 
     </head>
@@ -100,7 +110,8 @@ proc generateHtml*(filename: string) =
 
   outfile.write("""<ul id="tabs">""")
   
-  for lastCommit in db.getRow(sql"select id from [Commit] order by id desc"):
+  for thisCommit in db.rows(sql"select id from [Commit] order by id desc"):
+    let lastCommit = thisCommit[0]
     let commit = db.getValue(sql"select hash from [Commit] where id = ?",
                               lastCommit)
     let branch = db.getValue(sql"select branch from [Commit] where id = ?",
@@ -110,7 +121,8 @@ proc generateHtml*(filename: string) =
       lastCommit, branch, commit]
   outfile.write("</ul>")
   
-  for lastCommit in db.getRow(sql"select id from [Commit] order by id desc"):
+  for thisCommit in db.rows(sql"select id from [Commit] order by id desc"):
+    let lastCommit = thisCommit[0]
     outfile.write("""<div class="tabContent" id="$#">""" % lastCommit)
 
     outfile.write(TableHeader)