Index: runs.scm ================================================================== --- runs.scm +++ runs.scm @@ -233,13 +233,25 @@ ;; if either items or items table is a proc return it so test running ;; process can know to call items:get-items-from-config ;; if either is a list and none is a proc go ahead and call get-items ;; otherwise return #f - this is not an iterated test (cond - ((procedure? items) items) ;; calc later - ((procedure? itemstable) itemstable) ;; calc later + ((procedure? items) + (debug:print 4 "INFO: items is a procedure, will calc later") + items) ;; calc later + ((procedure? itemstable) + (debug:print 4 "INFO: itemstable is a procedure, will calc later") + itemstable) ;; calc later + ((filter (lambda (x) + (let ((val (car x))) + (if (procedure? val) val #f))) + (append (if (list? items) items '()) + (if (list? itemstable) itemstable '()))) + 'have-procedure) ((or (list? items)(list? itemstable)) ;; calc now + (debug:print 4 "INFO: items and itemstable are lists, calc now\n" + " items: " items " itemstable: " itemstable) (items:get-items-from-config config)) (else #f))) ;; not iterated #f ;; itemsdat 5 ;; #f ;; spare ))) @@ -329,16 +341,16 @@ items) (loop (car tal)(cdr tal))) ;; if items is a proc then need to run items:get-items-from-config, get the list and loop ;; - but only do that if resources exist to kick off the job - ((procedure? items) + ((or (procedure? items)(eq? items 'have-procedure)) (if (runs:can-run-more-tests db test-record) (let ((items-list (items:get-items-from-config tconfig))) (if (list? items-list) (begin - (tests:testqueue-set-items test-record items-list) + (tests:testqueue-set-items! test-record items-list) (loop hed tal)) (begin (debug:print 0 "ERROR: The proc from reading the setup did not yield a list - please report this") (exit 1)))) (let ((newtal (append tal (list hed)))) @@ -347,16 +359,16 @@ (loop (car newtal)(cdr newtal))))) ;; this case should not happen, added to help catch any bugs ((and (list? items) itemdat) (debug:print 0 "ERROR: Should not have a list of items in a test and the itemspath set - please report this") - (exit 1))) + (exit 1)))) - ;; we get here on "drop through" - loop for next test in queue - (if (null? tal) - (debug:print 1 "INFO: All tests launched") - (loop (car tal)(cdr tal))))))) + ;; we get here on "drop through" - loop for next test in queue + (if (null? tal) + (debug:print 1 "INFO: All tests launched") + (loop (car tal)(cdr tal)))))) ;; parent-test is there as a placeholder for when parent-tests can be run as a setup step (define (run:test db run-id runname keyvallst test-record flags parent-test) ;; All these vars might be referenced by the testconfig file reader (let* ((test-name (tests:testqueue-get-testname test-record)) Index: tests/tests/runfirst/main.sh ================================================================== --- tests/tests/runfirst/main.sh +++ tests/tests/runfirst/main.sh @@ -3,10 +3,12 @@ # megatest -step wasting_time :state start :status n/a -m "This is a test step comment" # sleep 20 # megatest -step wasting_time :state end :status $? touch ../I_was_here +mkdir -p $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME +echo 1 2 3 4 5 > $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans $MT_MEGATEST -runstep wasting_time -logpro wasting_time.logpro "sleep 8;echo all done eh?" -m "This is a test step comment" $MT_MEGATEST -load-test-data << EOF foo,bar,1.2,1.9,> ADDED tests/tests/test_mt_vars/testconfig Index: tests/tests/test_mt_vars/testconfig ================================================================== --- /dev/null +++ tests/tests/test_mt_vars/testconfig @@ -0,0 +1,20 @@ +[setup] + +[ezsteps] +lookittmp ls /tmp +lookithome ls /home + +[requirements] +waiton runfirst +priority 0 + +[items] +NUMNUM [system cat $MT_RUN_AREA_HOME/tmp/$USER/$sysname/$fsname/$datapath/$MT_RUNNAME/the_ans] + +[test_meta] +author matt +owner bob +description This test runs a single ezstep which is expected to pass, no logpro file. + +tags first,single +reviewed 09/10/2011, by Matt