@@ -1004,12 +1004,14 @@ ;; all prereqs must be met: ;; if prereq test with itempath='' is COMPLETED and PASS, WARN, CHECK, or WAIVED then prereq is met ;; if prereq test with itempath=ref-item-path and COMPLETED with PASS, WARN, CHECK, or WAIVED then prereq is met ;; ;; Note: do not convert to remote as it calls remote under the hood -;; -(define (db:get-prereqs-not-met db run-id waitons ref-item-path) +;; Note: mode 'normal means that tests must be COMPLETED and ok (i.e. PASS, WARN, CHECK or WAIVED) +;; mode 'toplevel means that tests must be COMPLETED only +;; +(define (db:get-prereqs-not-met db run-id waitons ref-item-path #!key (mode 'normal)) (if (or (not waitons) (null? waitons)) '() (let* ((unmet-pre-reqs '()) (result '())) @@ -1033,22 +1035,23 @@ (set! ever-seen #t) (cond ;; case 1, non-item (parent test) is ((and (equal? item-path "") ;; this is the parent test is-completed - is-ok) + (or is-ok (eq? mode 'toplevel))) (set! parent-waiton-met #t)) ((and same-itempath is-completed - is-ok) + (or is-ok (eq? mode 'toplevel))) (set! item-waiton-met #t))))) tests) (if (not (or parent-waiton-met item-waiton-met)) - (set! result (append tests result))) + (set! result (append (if (null? tests) (list waitontest-name) tests) result))) ;; if the test is not found then clearly the waiton is not met... ;; (if (not ever-seen)(set! result (cons waitontest-name result))))) - (if (not ever-seen)(set! result (append tests result))))) + (if (not ever-seen) + (set! result (append (if (null? tests)(list waitontest-name) tests) result))))) waitons) (delete-duplicates result)))) (define (db:teststep-set-status! db test-id teststep-name state-in status-in item-path comment logfile) (debug:print 4 "test-id: " test-id " teststep-name: " teststep-name)