@@ -212,10 +212,21 @@ run-id test-name (item-list->path itemdat))) ;; (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 tests WHERE id=?;" test-id)) + +;; set tests with state currstate and status currstatus to newstate and newstatus +;; use currstate = #f and or currstatus = #f to apply to any state or status respectively +;; WARNING: SQL injection risk +(define (db:set-tests-state-status db run-id tests currstate currstatus newstate newstatus) + (sqlite3:execute db (conc "UPDATE tests SET state=?,status=? WHERE " + (if currstate (conc "state='" currstate "' AND ") "") + (if currstatus (conc "status='" currstatus "' AND ") "") + " testname in " + "('" (string-intersperse tests "','") "')") + newstate newstatus)) (define (db:get-count-tests-running db) (let ((res 0)) (sqlite3:for-each-row (lambda (count)