Index: items.scm ================================================================== --- items.scm +++ items.scm @@ -8,12 +8,12 @@ ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;; (define itemdat '((ripeness "green ripe overripe") -;; (temperature "cool medium hot") -;; (season "summer winter fall spring"))) +;; (temperature "cool medium hot") +;; (season "summer winter fall spring"))) ;; Mostly worked = puts out all combinations? (define (process-itemlist-try1 curritemkey itemlist) (let loop ((hed (car itemlist)) (tal (cdr itemlist))) @@ -44,22 +44,65 @@ (set! res (append res (process-itemlist hierdepth (append curritemkey (list (list (car hed) item))) tal)))) (cadr hed)) (loop (car tal)(cdr tal))))) res)) +;; (item-assoc->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Fall"))) +;; => ((("ANIMAL" "Elephant") ("SEASON" "Spring")) +;; (("ANIMAL" "Elephant") ("SEASON" "Fall")) +;; (("ANIMAL" "Lion") ("SEASON" "Spring")) +;; (("ANIMAL" "Lion") ("SEASON" "Fall"))) (define (item-assoc->item-list itemsdat) (if (and itemsdat (not (null? itemsdat))) (let ((itemlst (map (lambda (x) (let ((name (car x)) (items (cadr x))) (list name (string-split items)))) itemsdat))) (process-itemlist #f '() itemlst)) - '(()))) ;; return a list consisting on a single null list for non-item runs + '())) ;; return a list consisting on a single null list for non-item runs + ;; Nope, not now, return null as of 6/6/2011 + +;; (item-table->item-list '(("ANIMAL" "Elephant Lion")("SEASON" "Spring Winter"))) +;; => ((("ANIMAL" "Elephant")("SEASON" "Spring")) +;; (("ANIMAL" "Lion") ("SEASON" "Winter"))) +(define (item-table->item-list itemtable) + (let ((newlst (map (lambda (x) + (if (> (length x) 1) + (list (car x) + (string-split (cadr x))) + x)) + itemtable)) + (res '())) ;; a list of items + (let loop ((indx 0) + (item '()) ;; an item will be ((KEYNAME1 VAL1)(KEYNAME2 VAL2) ...) + (elflag #f)) + (for-each (lambda (row) + (let ((rowname (car row)) + (rowdat (cadr row))) + (set! item (append item + (list + (if (< indx (length rowdat)) + (let ((new (list rowname (list-ref rowdat indx)))) + ;; (print "New: " new) + (set! elflag #t) + new + ) ;; i.e. had at least on legit value to use + (list rowname "-"))))))) + newlst) + (if elflag + (begin + (set! res (append res (list item))) + (loop (+ indx 1) + '() + #f))) + res))) + ;; Nope, not now, return null as of 6/6/2011 + (define-inline (item-list->path itemdat) (string-intersperse (map cadr itemdat) "/")) ;; (pp (item-assoc->item-list itemdat)) Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -284,14 +284,18 @@ (begin (print "ERROR: Can't find config file " test-configf) (exit 2)) ;; put top vars into convenient variables and open the db (let* (;; db is always at *toppath*/db/megatest.db - (items (hash-table-ref/default test-conf "items" #f)) - (allitems (item-assoc->item-list items)) + (items (hash-table-ref/default test-conf "items" '())) + (itemstable (hash-table-ref/default test-conf "itemstable" '())) + (allitems (if (or (not (null? items))(not (null? itemstable))) + (append (item-assoc->item-list items) + (item-table->item-list itemstable)) + '(()))) ;; a list with one null list is a test with no items (runconfigf (conc *toppath* "/runconfigs.config"))) - ;; (print "items: ")(pp allitems) + (print "items: ")(pp allitems) (if (args:get-arg "-m") (db:set-comment-for-run db run-id (args:get-arg "-m"))) (let loop ((itemdat (car allitems)) (tal (cdr allitems))) ;; (lambda (itemdat) ;;; ((ripeness "overripe") (temperature "cool") (season "summer")) Index: tests/tests/runfirst/testconfig ================================================================== --- tests/tests/runfirst/testconfig +++ tests/tests/runfirst/testconfig @@ -11,6 +11,10 @@ # to choose the target host, select the launch tool etc. SPECIAL_ENV_VAR override with everything after the first space. [items] SEASON summer winter fall spring + +[itemstable] +BLOCK a b +TOCK 1 2 Index: tests/tests/runfirst/wasting_time.logpro ================================================================== --- tests/tests/runfirst/wasting_time.logpro +++ tests/tests/runfirst/wasting_time.logpro @@ -2,14 +2,14 @@ ;; NOTE: This is not legit logpro code!!! ;; Test for 0=PASS, 1=WARN, >2 = FAIL -(define season (get-environment-variable "SEASON")) - -(exit - (case (string->symbol season) - ((summer) 0) - ((winter) 1) - ((fall) 2) - (else 0))) +;; (define season (get-environment-variable "SEASON")) +;; +;; (exit +;; (case (string->symbol season) +;; ((summer) 0) +;; ((winter) 1) +;; ((fall) 2) +;; (else 0)))