Index: db.scm ================================================================== --- db.scm +++ db.scm @@ -3266,13 +3266,13 @@ ;; A routine to map itempaths using a itemmap (define (db:compare-itempaths patha pathb itemmap) (debug:print-info 6 "ITEMMAP is " itemmap) (if itemmap - (let ((path-b-mapped (db:convert-test-itempath pathb itemmap))) - (debug:print-info 6 "ITEMMAP is " itemmap ", path: " pathb ", mapped path: " path-b-mapped) - (equal? patha pathb)) + (let ((pathb-mapped (db:multi-pattern-apply pathb itemmap))) + (debug:print-info 6 "ITEMMAP is " itemmap ", path: " pathb ", mapped path: " pathb-mapped) + (equal? patha pathb-mapped)) (equal? patha pathb))) ;; (let* ((mapparts (string-split itemmap)) ;; (pattern (car mapparts)) ;; (replacement (if (> (length mapparts) 1) (cadr mapparts) ""))) @@ -3281,10 +3281,13 @@ ;; (string-substitute pattern replacement pathb)) ;; (equal? (string-substitute pattern "" patha) ;; (string-substitute pattern "" pathb)))) ;; A routine to convert test/itempath using a itemmap +;; NOTE: to process only an itempath (i.e. no prepended testname) +;; just call db:multi-pattern-apply +;; (define (db:convert-test-itempath path-in itemmap) (debug:print-info 6 "ITEMMAP is " itemmap) (let* ((path-parts (string-split path-in "/")) (test-name (if (null? path-parts) "" (car path-parts))) (item-path (string-intersperse (if (null? path-parts) '() (cdr path-parts)) "/"))) Index: tests/unittests/runs.scm ================================================================== --- tests/unittests/runs.scm +++ tests/unittests/runs.scm @@ -99,11 +99,11 @@ (let ((dat (rmt:testmeta-get-record "test1"))) (vector-ref dat 1)))) (define test-path "tests/test1") (define disk-path #f) -(test "get-best-disk" #t (string? (file-exists? (let ((d (get-best-disk *configdat*))) +(test "get-best-disk" #t (string? (file-exists? (let ((d (get-best-disk *configdat* #f))) (set! disk-path d) d)))) (test "create-work-area" #t (symbolic-link? (car (create-work-area 1 rinfo keyvals 1 test-path disk-path "test1" '())))) (test #f "" (item-list->path '())) @@ -157,12 +157,23 @@ ;;====================================================================== ;; M O R E R E M O T E C A L L S ;;====================================================================== -(test #f #f (rmt:set-tests-state-status 1 '("runfirst") "RUNNING" "WARN" "COMPLETED" "FAIL")) -(test #f #f (rmt:top-test-set-per-pf-counts 1 "runfirst")) +(test #f '("COMPLETED" "PASS") + (begin + (rmt:set-tests-state-status 1 '("rollup") "COMPLETED" "AUTO" "COMPLETED" "PASS") + (get-state-status 1 "rollup" ""))) +(test #f #t (rmt:top-test-set-per-pf-counts 1 "rollup")) + +;;====================================================================== +;; T E S T I T E M M A P +;;====================================================================== + +(test #f "a/b/c" (db:multi-pattern-apply "d/e/f" "d a\ne b\nf c")) +(test #f "blah/foo/bar/baz" (db:convert-test-itempath "blah/baz/bar/foo" "^([^/]+)/([^/]+)/([^/]+)$ \\3/\\2/\\1")) +(test #f #t (db:compare-itempaths "abc/def/123" "abc/ghi/123" "ghi def")) (exit 1)