Index: dashboard.scm ================================================================== --- dashboard.scm +++ dashboard.scm @@ -2282,11 +2282,11 @@ (define (dashboard:runs-summary commondat tabdat #!key (tab-num #f)) (let* ((update-mutex (dboard:commondat-update-mutex commondat)) (tb (iup:treebox #:value 0 ;;#:name "Runs" - #:title "Runs" ;; was #:name -- iup 3.19 changed this... "Changed: [DEPRECATED REMOVED] removed the old attribute NAMEid from IupTree to avoid conflict with the common attribute NAME. Use the TITLEid attribute." + #:title "Runs" #:expand "YES" #:addexpanded "YES" #:selection-cb (lambda (obj id state) (debug:catch-and-dump ADDED utils/mt-new-to-old.scm Index: utils/mt-new-to-old.scm ================================================================== --- /dev/null +++ utils/mt-new-to-old.scm @@ -0,0 +1,73 @@ +(module mt-new-to-old + * + +(import + scheme + chicken.file + chicken.base + chicken.string + chicken.pretty-print + sqlite3) + +(if (not (file-exists? ".megatest/main.db")) + (begin + (print "No .megatest/main.db found, exiting") + (exit 1))) + +(copy-file ".megatest/main.db" "megatest.db" #t) + + +(define tests_fields "run_id,testname,host,cpuload,diskfree,uname,rundir,shortdir,item_path,state,status,attemptnum,final_logf,logdat,run_duration,comment,event_time,fail_count,pass_count,archived") + +(define extra_fields "testname,item_path") + +(define (import-one dbfile destdb) + (print "Importing "dbfile) + (let* ((db (open-database dbfile)) + (rows (fold-row + (lambda (res . row) + (cons row res)) + '() + db + (conc "SELECT "extra_fields","tests_fields" FROM tests;")))) + (finalize! db) + (print "Found "(length rows)" records to insert.") + (for-each + (lambda (row) + (let* ((testname (car row)) + (itempath (cadr row)) + (remrow (cddr row)) + (run-id (car remrow)) + (ready-row (string-intersperse + (map (lambda (x) + (if (number? x) + (conc x) + (conc "'"x"'"))) + remrow) + + ","))) + (print run-id","testname"/"itempath) + (execute destdb "DELETE FROM tests WHERE testname=? AND item_path=? AND run_id=?;" + (or testname "") + (or itempath "") + (or run-id "")) + (apply execute destdb (conc "INSERT INTO tests ("tests_fields") VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);") remrow))) + ;; ("ready-row");")))) + rows))) + +(define (process-all) + (let* ((outdb (open-database "megatest.db")) + (indbs (glob ".megatest/[0-9]*.db"))) + (with-transaction + outdb + (lambda () + (for-each + (lambda (dbfname) + (import-one dbfname outdb)) + indbs))) + (finalize! outdb))) + +) + +(import mt-new-to-old) +(process-all)