Index: common.scm ================================================================== --- common.scm +++ common.scm @@ -646,22 +646,27 @@ ;; hash-table tree to html list tree ;; ;; tipfunc takes two parameters: y the tip value and path the path to that point ;; (define (common:htree->html ht path tipfunc) - (s:ul - (map (lambda (x) - (let ((levelname (car x))) - (s:li - levelname - (let ((y (cdr x)) - (newpath (append path (list levelname)))) - ;; (print "levelname=" levelname " newpath=" newpath) - (if (hash-table? y) - (common:htree->html y newpath tipfunc) - (tipfunc y newpath)))))) - (hash-table->alist ht)))) + (let ((datlist (hash-table->alist ht))) + (if (null? datlist) + (tipfunc #f path) ;; really shouldn't get here + (s:ul + (map (lambda (x) + (let* ((levelname (car x)) + (y (cdr x)) + (newpath (append path (list levelname))) + (leaf (or (not (hash-table? y)) + (null? (hash-table-keys y))))) + (if leaf + (s:li (tipfunc y newpath)) + (s:li + (list + levelname + (common:htree->html y newpath tipfunc)))))) + datlist))))) ;; hash-table tree to alist tree ;; (define (common:htree->atree ht) (map (lambda (x) Index: tests.scm ================================================================== --- tests.scm +++ tests.scm @@ -641,40 +641,49 @@ ) ;; (tests:create-html-tree "test-index.html") ;; (define (tests:create-html-tree outf) - (if (common:simple-file-lock (conc outf ".lock")) - (let* ((oup (open-output-file outf)) - (area-name (common:get-testsuite-name)) - (keys (rmt:get-keys)) - (numkeys (length keys)) - (runsdat (rmt:get-runs "%" #f #f (map (lambda (x)(list x "%")) keys))) - (header (vector-ref runsdat 0)) - (runs (vector-ref runsdat 1)) - (runtreedat (map (lambda (x) - (append (take (vector->list x) numkeys) - (list (vector-ref x (+ 1 numkeys))))) ;; gets the runname - runs)) - (runs-htree (common:list->htree runtreedat))) - (s:output-new - oup - (s:html tests:css-jscript-block - (s:title "Summary for " area-name) - (s:body 'onload "addEvents();" - ;; top list - (s:ul 'id "LinkedList1" 'class "LinkedList" - (s:li - "Runs" - (common:htree->html runs-htree - '() - (lambda (x p) - (apply s:a x p)))))))) - (close-output-port oup) - (common:simple-file-release-lock (conc outf ".lock")) - #t) - #f)) + (let* ((lockfile (conc outf ".lock")) + (runs-to-process '())) + (if (common:simple-file-lock lockfile) + (let* ((linktree (common:get-linktree)) + (oup (open-output-file outf)) + (area-name (common:get-testsuite-name)) + (keys (rmt:get-keys)) + (numkeys (length keys)) + (runsdat (rmt:get-runs "%" #f #f (map (lambda (x)(list x "%")) keys))) + (header (vector-ref runsdat 0)) + (runs (vector-ref runsdat 1)) + (runtreedat (map (lambda (x) + (append (take (vector->list x) numkeys) + (list (vector-ref x (+ 1 numkeys))))) ;; gets the runname + runs)) + (runs-htree (common:list->htree runtreedat))) + (set! runs-to-process runs) + (s:output-new + oup + (s:html tests:css-jscript-block + (s:title "Summary for " area-name) + (s:body 'onload "addEvents();" + (s:h1 "Summary for " area-name) + ;; top list + (s:ul 'id "LinkedList1" 'class "LinkedList" + (s:li + "Runs" + (common:htree->html runs-htree + '() + (lambda (x p) + (let ((targpath (string-intersperse p "/")) + (runname (car (reverse p)))) + (s:a runname 'href (conc targpath "/runsummary.html")))) + )))))) + (close-output-port oup) + (common:simple-file-release-lock lockfile) + ; ( + #t) + #f))) ;; (let* ((outputfilename (conc "megatest-rollup-" test-name ".html")) ;; (orig-dir (current-directory)) ;; (logf-info (rmt:test-get-logfile-info run-id test-name)) ;; (logf (if logf-info (cadr logf-info) #f))