@@ -216,15 +216,15 @@ (c2 (map string->number (string-split color2))) (delta (map (lambda (a b)(abs (- a b))) c1 c2))) (null? (filter (lambda (x)(> x 3)) delta)))) (define (compare-tests test1 test2) - (let* ((test-name1 (db:test-testname test1)) - (item-path1 (db:test-item-path test1)) + (let* ((test-name1 (or (db:test-testname test1) "")) + (item-path1 (or (db:test-item-path test1) "")) (eventtime1 (db:test-event_time test1)) - (test-name2 (db:test-testname test2)) - (item-path2 (db:test-item-path test2)) + (test-name2 (or (db:test-testname test2) "")) + (item-path2 (or (db:test-item-path test2) "")) (eventtime2 (db:test-event_time test2)) (same-name (equal? test-name1 test-name2)) (test1-top (equal? item-path1 "")) (test2-top (equal? item-path2 "")) (test1-older (> eventtime1 eventtime2)) @@ -388,12 +388,12 @@ ;; (define (get-itemized-tests test-dats) (let ((tnames '())) (for-each (lambda (tdat) - (let ((tname (db:test-testname tdat)) ;; (db:test-get-testname tdat)) - (ipath (db:test-item-path tdat) ) ) ;; (db:test-get-item-path tdat))) + (let ((tname (vector-ref tdat 0)) ;; (db:test-testname tdat)) ;; (db:test-get-testname tdat)) + (ipath (vector-ref tdat 1))) ;; (db:test-item-path tdat) ) ) ;; (db:test-get-item-path tdat))) (if (not (equal? ipath "")) (if (and (list? tnames) (string? tname) (not (member tname tnames))) (set! tnames (append tnames (list tname))))))) @@ -410,12 +410,12 @@ (let* ((tnames '()) ;; list of names used to reserve order (tests (make-hash-table)) ;; hash of lists, used to build as we go (itemized (get-itemized-tests test-dats))) (for-each (lambda (testdat) - (let* ((tname (db:test-testname tdat)) ;; (db:test-get-testname tdat)) - (ipath (db:test-item-path tdat))) ;; (db:test-get-item-path tdat))) + (let* ((tname (vector-ref testdat 0)) ;; (db:test-testname tdat)) ;; (db:test-get-testname tdat)) + (ipath (vector-ref testdat 1))) ;; (db:test-item-path tdat))) ;; (db:test-get-item-path tdat))) ;; (seen (hash-table-ref/default tests tname #f))) (if (not (member tname tnames)) (if (or (and (eq? priority 'itempath) (not (equal? ipath ""))) (and (eq? priority 'testname) @@ -508,11 +508,25 @@ (if buttondat (let* ((test (let ((matching (filter (lambda (x)(equal? (test:test-get-fullname x) testname)) testsdat))) (if (null? matching) - (vector -1 -1 "" "" "" 0 "" "" 0 "" "" "" 0 "" "") + (make-db:test id: -1 + run_id: -1 + testname: "" + state: "" + status: "" + event_time: 0 + host: "" + cpuload: "" + diskfree: 0 + uname: "" + rundir: "" + item-path: "" + run_duration: 0 + final_logf: "" + comment: "") (car matching)))) (testname (db:test-testname test)) (itempath (db:test-item-path test)) (testfullname (test:test-get-fullname test)) (teststatus (db:test-status test))