Index: megatest.scm ================================================================== --- megatest.scm +++ megatest.scm @@ -2652,11 +2652,10 @@ (debug:print 0 *default-log-port* "Add '-remove-dbs all' to remove the current Megatest DBs.") (set! *didsomething* #t) (exit) ) ) - (debug:print 0 *default-log-port* "Did not find " (conc toppath "/.mtdb")) ) (db:setup) (rmt:import-sexpr (args:get-arg "-import-sexpr")) (set! *didsomething* #t))) Index: rmtmod.scm ================================================================== --- rmtmod.scm +++ rmtmod.scm @@ -89,21 +89,28 @@ (tests-data (alist-ref "data" all-dat equal?)) (run-meta (alist-ref "meta" all-dat equal?)) (run-id (string->number (alist-ref "id" run-meta equal?)))) (rmt:insert-run run-id target runname run-meta) - (for-each - (lambda (test-dat) - (let* ((test-id (car test-dat)) + (if (list? tests-data) + (begin + (debug:print 0 *default-log-port* "import-run: inserting " (length tests-data) " tests") + (for-each + (lambda (test-dat) + (let* ((test-id (car test-dat)) (test-rec (cdr test-dat))) - (rmt:insert-test run-id test-rec))) - tests-data))) + (rmt:insert-test run-id test-rec))) + tests-data) + ) + (debug:print 0 *default-log-port* "import-run: run has no tests") + ) + ) +) ;; insert run if not there, return id either way (define (rmt:insert-run run-id target runname run-meta) ;; look for id, return if found - (debug:print 0 *default-log-port* "Insert run: "target"/"runname) (let* ((runs (rmtmod:send-receive 'simple-get-runs #f ;; runpatt count offset target last-update) (list runname #f #f target #f)))) (if (null? runs) (begin @@ -110,12 +117,11 @@ (debug:print 0 *default-log-port* "inserting run for runname " runname " target " target) (rmtmod:send-receive 'insert-run #f (list run-id target runname run-meta)) ) (begin (debug:print 0 *default-log-port* "Found run-id " (simple-run-id (car runs)) " for runname " runname " target " target) - (simple-run-id (car runs) - ) + (simple-run-id (car runs)) )))) (define (rmt:insert-test run-id test-rec) (let* ((testname (alist-ref "testname" test-rec equal?)) (item-path (alist-ref "item_path" test-rec equal?)))