Megatest

Check-in [b50d150110]
Login
Overview
Comment:Added collapse/expand for itemized tests and completed alternative sort methods
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.55
Files: files | file ages | folders
SHA1: b50d150110f087653ca7221675ee3f8bdee933bf
User & Date: mrwellan on 2013-08-19 15:58:55
Other Links: branch diff | manifest | tags
Context
2013-08-19
23:52
Fixed minor issue with ods check-in: c90f28e6b2 user: matt tags: v1.55
15:58
Added collapse/expand for itemized tests and completed alternative sort methods check-in: b50d150110 user: mrwellan tags: v1.55
15:42
Added collapse/expand for itemized tests and completed alternative sort methods check-in: 48f16932ad user: mrwellan tags: v1.55
Changes

Modified dashboard.scm from [ff304606c8] to [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))