Megatest

Check-in [76c9be4669]
Login
Overview
Comment:Add local: #t to struct construction
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | v1.60
Files: files | file ages | folders
SHA1: 76c9be466920e7d02c856192c013d6d3af31cafe
User & Date: matt on 2014-09-11 01:05:11
Other Links: branch diff | manifest | tags
Context
2014-09-11
09:54
Initial pass at re-numbering tests to prevent overlap check-in: 06b8e0ec89 user: mrwellan tags: v1.60
01:05
Add local: #t to struct construction check-in: 76c9be4669 user: matt tags: v1.60
2014-09-10
22:51
Fixed missing launch: in call to setup-for-run check-in: 3222769b73 user: matt tags: v1.60
Changes

Modified db.scm from [38cafde93b] to [0a54967839].

1617
1618
1619
1620
1621
1622
1623
1624

1625
1626
1627

1628
1629
1630
1631
1632
1633
1634
1617
1618
1619
1620
1621
1622
1623

1624
1625
1626

1627
1628
1629
1630
1631
1632
1633
1634







-
+


-
+








(define (db:replace-test-records dbstruct run-id testrecs)
  (db:with-db dbstruct run-id #t 
	      (lambda (db)
		(let* ((qmarks (string-intersperse (make-list (length db:test-record-fields) "?") ","))
		       (qrystr (conc "INSERT OR REPLACE INTO tests (" db:test-record-qry-selector ") VALUES (" qmarks ");"))
		       (qry    (sqlite3:prepare db qrystr)))
		  ;; (debug:print 8 "INFO: replace-test-records, qrystr=" qrystr)
		  (debug:print 0 "INFO: replace-test-records, qrystr=" qrystr)
		  (for-each 
		   (lambda (rec)
		     (debug:print 0 "INFO: Inserting values: " (string-intersperse (map conc (vector->list rec)) ", "))
		     (debug:print 0 "INFO: Inserting values: " (string-intersperse (map conc (vector->list rec)) ",") "\n")
		     (apply sqlite3:execute qry (vector->list rec)))
		   testrecs)
		  (sqlite3:finalize! qry)))))
	

;; Get test data using test_id
(define (db:get-test-info-by-id dbstruct run-id test-id)

Modified megatest.scm from [de434ab584] to [a912771518].

1296
1297
1298
1299
1300
1301
1302
1303

1304
1305


1306
1307
1308
1309
1310
1311
1312
1296
1297
1298
1299
1300
1301
1302

1303
1304

1305
1306
1307
1308
1309
1310
1311
1312
1313







-
+

-
+
+







	   (mtdb     (if toppath (db:open-megatest-db)))
	   (run-ids  (if toppath (db:get-all-run-ids mtdb))))
      ;; sync runs, test_meta etc.
      (db:sync-tables (db:sync-main-list mtdb) mtdb (db:get-db dbstruct #f))
      (for-each 
       (lambda (run-id)
	 (let ((testrecs (db:get-all-tests-info-by-run-id mtdb run-id))
	       (dbstruct (if toppath (make-dbr:dbstruct path: toppath) #f)))
	       (dbstruct (if toppath (make-dbr:dbstruct path: toppath local: #t) #f)))
	   (debug:print 0 "INFO: Updating " (length testrecs) " records for run-id=" run-id)
	   (db:replace-test-records dbstruct run-id testrecs)))
	   (db:replace-test-records dbstruct run-id testrecs)
	   (sqlite3:finalize! (dbr:dbstruct-get-rundb dbstruct))))
       run-ids)
      (set! *didsomething* #t)
      (db:close-all dbstruct)))

;;======================================================================
;; Exit and clean up
;;======================================================================