211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
value REAL,
expected REAL,
tol REAL,
units TEXT,
comment TEXT DEFAULT '',
status TEXT DEFAULT 'n/a',
CONSTRAINT test_data UNIQUE (test_id,category,variable));")
(print "WARNING: Table test_data and test_meta where recreated. Please do megatest -update-meta")
(patch-db))
((< mver 1.27)
(db:set-var db "MEGATEST_VERSION" 1.27)
(sqlite3:execute db "ALTER TABLE test_data ADD COLUMN type TEXT DEFAULT '';")
(patch-db))
((< mver 1.29)
(db:set-var db "MEGATEST_VERSION" 1.29)
|
|
|
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
|
value REAL,
expected REAL,
tol REAL,
units TEXT,
comment TEXT DEFAULT '',
status TEXT DEFAULT 'n/a',
CONSTRAINT test_data UNIQUE (test_id,category,variable));")
(print "WARNING: Table test_data and test_meta were recreated. Please do megatest -update-meta")
(patch-db))
((< mver 1.27)
(db:set-var db "MEGATEST_VERSION" 1.27)
(sqlite3:execute db "ALTER TABLE test_data ADD COLUMN type TEXT DEFAULT '';")
(patch-db))
((< mver 1.29)
(db:set-var db "MEGATEST_VERSION" 1.29)
|
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
|
(sqlite3:for-each-row (lambda (id)
(set! ids (cons id ids)))
db
"SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?;"
run-id test-name (item-list->path itemdat))
(for-each (lambda (id)
(sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" id)
(thread-sleep! 0.1)) ;; give others access to the db
ids)))
;;"DELETE FROM test_steps WHERE test_id in (SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?);"
;;
(define (db:delete-test-records db test-id)
(sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" test-id)
(sqlite3:execute db "DELETE FROM test_data WHERE test_id=?;" test-id)
|
>
>
|
|
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
|
(sqlite3:for-each-row (lambda (id)
(set! ids (cons id ids)))
db
"SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?;"
run-id test-name (item-list->path itemdat))
(for-each (lambda (id)
(sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" id)
(thread-sleep! 0.1) ;; give others access to the db
(sqlite3:execute db "DELETE FROM test_data WHERE test_id=?;" id)
(thread-sleep! 0.1)) ;; give others access to the db
ids)))
;;"DELETE FROM test_steps WHERE test_id in (SELECT id FROM tests WHERE run_id=? AND testname=? AND item_path=?);"
;;
(define (db:delete-test-records db test-id)
(sqlite3:execute db "DELETE FROM test_steps WHERE test_id=?;" test-id)
(sqlite3:execute db "DELETE FROM test_data WHERE test_id=?;" test-id)
|
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
|
(define (db:test-set-rundir! db run-id test-name item-path rundir)
(sqlite3:execute
db
"UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;"
rundir run-id test-name item-path))
(define (db:test-set-log! db run-id test-name item-path logf)
(sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path=?;"
logf run-id test-name item-path))
;;======================================================================
;; Misc. test related queries
;;======================================================================
(define (db:test-get-paths-matching db keynames target)
(let* ((res '())
|
>
|
|
>
|
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
|
(define (db:test-set-rundir! db run-id test-name item-path rundir)
(sqlite3:execute
db
"UPDATE tests SET rundir=? WHERE run_id=? AND testname=? AND item_path=?;"
rundir run-id test-name item-path))
(define (db:test-set-log! db run-id test-name item-path logf)
(if (string? logf)
(sqlite3:execute db "UPDATE tests SET final_logf=? WHERE run_id=? AND testname=? AND item_path=?;"
logf run-id test-name item-path)
(debug:print 0 "ERROR: db:test-set-log! called with non-string log file name " logf)))
;;======================================================================
;; Misc. test related queries
;;======================================================================
(define (db:test-get-paths-matching db keynames target)
(let* ((res '())
|