Megatest

Diff
Login

Differences From Artifact [ff304606c8]:

To Artifact [64bb5aea71]:


311
312
313
314
315
316
317



318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333


334


335

336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
	(if (< i maxn)
	    (loop (+ i 1)))))))

;; Bubble up the top tests to above the items, collect the items underneath
;; all while preserving the sort order from the SQL query as best as possible.
;;
(define (bubble-up test-dats)



  (let* ((tnames '())                ;; list of names used to reserve order
	 (tests  (make-hash-table))) ;; hash of lists, used to build as we go
    (for-each 
     (lambda (testdat)
       (let* ((tname (db:test-get-testname testdat))
	      (ipath (db:test-get-item-path testdat))
	      (seen  (hash-table-ref/default tests tname #f)))
	 (if (not seen)(set! tnames (append tnames (list tname))))
	 (if (equal? ipath "")
	      ;; This a top level, prepend it
	     (hash-table-set! tests tname (cons testdat (hash-table-ref/default tests tname '())))
	     ;; This is item, append it
	     (hash-table-set! tests tname (append (hash-table-ref/default tests tname '())(list testdat))))))
     test-dats)
    ;; Set all tests with items 
    (set! *all-item-test-names* (filter (lambda (tname)


				     (> (length (hash-table-ref tests tname)) 1))


				   tnames))

    (let loop ((hed (car tnames))
	       (tal (cdr tnames))
	       (res '()))
      (let ((newres (append res (hash-table-ref tests hed))))
	(if (null? tal)
	    newres
	    (loop (car tal)(cdr tal) newres))))))

(define (update-buttons uidat numruns numtests)
  (let* ((runs        (if (> (length *allruns*) numruns)
			  (take-right *allruns* numruns)
			  (pad-list *allruns* numruns)))
	 (lftcol      (dboard:uidat-get-lftcol uidat))
	 (tableheader (dboard:uidat-get-header uidat))
	 (table       (dboard:uidat-get-runsvec uidat))







>
>
>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
>
>
|
>
>
|
>
|
|
|
|
|
|
|
|







311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
	(if (< i maxn)
	    (loop (+ i 1)))))))

;; Bubble up the top tests to above the items, collect the items underneath
;; all while preserving the sort order from the SQL query as best as possible.
;;
(define (bubble-up test-dats)
  (if (null? test-dats)
      test-dats
      (begin
	(let* ((tnames '())                ;; list of names used to reserve order
	       (tests  (make-hash-table))) ;; hash of lists, used to build as we go
	  (for-each 
	   (lambda (testdat)
	     (let* ((tname (db:test-get-testname testdat))
		    (ipath (db:test-get-item-path testdat))
		    (seen  (hash-table-ref/default tests tname #f)))
	       (if (not seen)(set! tnames (append tnames (list tname))))
	       (if (equal? ipath "")
		   ;; This a top level, prepend it
		   (hash-table-set! tests tname (cons testdat (hash-table-ref/default tests tname '())))
		   ;; This is item, append it
		   (hash-table-set! tests tname (append (hash-table-ref/default tests tname '())(list testdat))))))
	   test-dats)
	;; Set all tests with items 
	  (set! *all-item-test-names* (append (if (null? tnames)
						  '()
						  (filter (lambda (tname)
							    (let ((tlst (hash-table-ref tests tname)))
							      (and (list tlst)
								   (> (length tlst) 1))))
							  tnames))
					      *all-item-test-names*))
	  (let loop ((hed (car tnames))
		     (tal (cdr tnames))
		     (res '()))
	    (let ((newres (append res (hash-table-ref tests hed))))
	      (if (null? tal)
		  newres
		  (loop (car tal)(cdr tal) newres))))))))
      
(define (update-buttons uidat numruns numtests)
  (let* ((runs        (if (> (length *allruns*) numruns)
			  (take-right *allruns* numruns)
			  (pad-list *allruns* numruns)))
	 (lftcol      (dboard:uidat-get-lftcol uidat))
	 (tableheader (dboard:uidat-get-header uidat))
	 (table       (dboard:uidat-get-runsvec uidat))