Megatest

Diff
Login

Differences From Artifact [15ecc35fb6]:

To Artifact [572d71d91a]:


680
681
682
683
684
685
686

687

688
689

690
691
692




693
694
695
696
697
698
699
680
681
682
683
684
685
686
687

688
689
690
691
692
693

694
695
696
697
698
699
700
701
702
703
704







+
-
+


+


-
+
+
+
+







    numruns))

;; get some basic run stats
;;
;; ( (runname (( state  count ) ... ))
;;   (   ...  
(define (db:get-run-stats db)
  (let ((totals       (make-hash-table))
  (let ((res          '()))
	(res          '()))
    (sqlite3:for-each-row
     (lambda (runname state count)
       (hash-table-set! totals state (+ (hash-table-ref/default totals state 0) count))
       (set! res (cons (list runname state count) res)))
     db
     "SELECT runname,t.state,count(t.id) FROM runs AS r INNER JOIN tests AS t ON r.id=t.run_id GROUP BY t.state,runname;" )
    "SELECT runname,t.state||'/'||t.status AS s,count(t.id) FROM runs AS r INNER JOIN tests AS t ON r.id=t.run_id GROUP BY s,runname;" )
    (for-each (lambda (state)
		(set! res (cons (list "Totals" state (hash-table-ref totals state)) res)))
	      (hash-table-keys totals))
    res))

;; db:get-runs-by-patt
;; get runs by list of criteria
;; register a test run with the db
;;
;; Use: (db-get-value-by-header (db:get-header runinfo)(db:get-row runinfo))