Index: tests/dep-tests/common.testconfig ================================================================== --- tests/dep-tests/common.testconfig +++ tests/dep-tests/common.testconfig @@ -1,10 +1,24 @@ [ezsteps] delay sleep $SPEED;echo "Delayed $SPEED seconds" -[requirements] -#{getenv WAITON_#{getenv MT_TEST_NAME}} +# lookup table for waitons +# +[std] +genlib setup +test1 genlib +aggregate test1 +test2 aggregate +results test2 + +# simple removes the challenging "aggregate" dependency between test1 and test2. +# and the itempatt irregularity from genlib -> test1 +# +[simple] +test1 setup +test2 test1 +results test2 [test_meta] author matt owner matt description This is a common testconfig shared by all the tests @@ -12,5 +26,9 @@ [logpro] delay ;; Delay step logpro (expect:required in "LogFileBody" > 0 "Delayed message" #/Delayed \d+ seconds/) reviewed 09/10/2011, by Matt + +[requirements] +mode itemwait + Index: tests/dep-tests/tests/aggregate/testconfig ================================================================== --- tests/dep-tests/tests/aggregate/testconfig +++ tests/dep-tests/tests/aggregate/testconfig @@ -1,2 +1,4 @@ [include #{getenv MT_RUN_AREA_HOME}/common.testconfig] +[requirements] +waiton #{get #{getenv DEPS} aggregate} Index: tests/dep-tests/tests/genlib/testconfig ================================================================== --- tests/dep-tests/tests/genlib/testconfig +++ tests/dep-tests/tests/genlib/testconfig @@ -1,5 +1,8 @@ [include #{getenv MT_RUN_AREA_HOME}/common.testconfig] [itemstable] VIEWTYPE layout schematic +[requirements] +waiton #{get #{getenv DEPS} genlib} + Index: tests/dep-tests/tests/results/testconfig ================================================================== --- tests/dep-tests/tests/results/testconfig +++ tests/dep-tests/tests/results/testconfig @@ -1,2 +1,5 @@ [include #{getenv MT_RUN_AREA_HOME}/common.testconfig] +[requirements] +waiton #{get #{getenv DEPS} results} + Index: tests/dep-tests/tests/test1/testconfig ================================================================== --- tests/dep-tests/tests/test1/testconfig +++ tests/dep-tests/tests/test1/testconfig @@ -1,3 +1,7 @@ [include #{getenv MT_RUN_AREA_HOME}/common.testconfig] [include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] + +[requirements] +waiton #{get #{getenv DEPS} test1} + Index: tests/dep-tests/tests/test2/testconfig ================================================================== --- tests/dep-tests/tests/test2/testconfig +++ tests/dep-tests/tests/test2/testconfig @@ -1,3 +1,7 @@ [include #{getenv MT_RUN_AREA_HOME}/common.testconfig] [include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] + +[requirements] +waiton #{get #{getenv DEPS} test2} + ADDED tests/dynamic-waiton-example/common.testconfig Index: tests/dynamic-waiton-example/common.testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/common.testconfig @@ -0,0 +1,16 @@ +[ezsteps] +delay sleep $SPEED;echo "Delayed $SPEED seconds" + +[requirements] +#{getenv WAITON_#{getenv MT_TEST_NAME}} + +[test_meta] +author matt +owner matt +description This is a common testconfig shared by all the tests + +[logpro] +delay ;; Delay step logpro + (expect:required in "LogFileBody" > 0 "Delayed message" #/Delayed \d+ seconds/) + +reviewed 09/10/2011, by Matt ADDED tests/dynamic-waiton-example/common_itemstable.testconfig Index: tests/dynamic-waiton-example/common_itemstable.testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/common_itemstable.testconfig @@ -0,0 +1,4 @@ +[itemstable] +VIEW layout layout layout schematic schematic schematic +CELL ntran ptran diode ntran ptran diode + ADDED tests/dynamic-waiton-example/megatest.config Index: tests/dynamic-waiton-example/megatest.config ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/megatest.config @@ -0,0 +1,67 @@ +[fields] +# this field changes the dep tree +DEPS TEXT + +# this field changes the test run time; 0 .. N or random +SPEED TEXT + +[dashboard] +pre-command xterm -geometry 180x20 -e " +post-command |& tee results.log ;echo Press any key to continue;bash -c 'read -n 1 -s'" & +testsort -event_time + +[misc] +home #{shell readlink -f $MT_RUN_AREA_HOME} +parent #{shell readlink -f $MT_RUN_AREA_HOME/..} + +[setup] +linktree #{get misc parent}/links +max_concurrent_jobs 100000 +# It is possible (but not recommended) to override the rsync command used +# to populate the test directories. For test development the following +# example can be useful +# +testcopycmd cp --remove-destination -rsv TEST_SRC_PATH/. TEST_TARG_PATH/. >> TEST_TARG_PATH/mt_launch.log 2>> TEST_TARG_PATH/mt_launch.log + +# or for hard links + +# testcopycmd cp --remove-destination -rlv TEST_SRC_PATH/. TEST_TARG_PATH/. + +# override the logview command +# +logviewer (%MTCMD%) 2> /dev/null > /dev/null + +# override the html viewer launch command +# +# htmlviewercmd firefox -new-window +htmlviewercmd arora + +[env-override] +# MT_XTERM_CMD overrides the terminal command +# MT_XTERM_CMD xterm -bg lightgreen -fg black + +## disks are: +## name host:/path/to/area +## -or- +## name /path/to/area +[disks] +disk0 #{get misc parent}/runs + +#====================================================================== +# Machine flavors +# +# These specify lists of hosts or scripts to use or call for various +# flavors of task. +# +#====================================================================== + +[flavors] + +plain hosts: xena, phoebe +strong command: NBFAKE_HOST=zeus nbfake +arm hosts: cubian + +# Uncomment these to emulate a job queue with a long time (look in bin/sleeprunner for the time) +[jobtools] +launcher nbfake +maxload 2.0 ADDED tests/dynamic-waiton-example/runconfigs.config Index: tests/dynamic-waiton-example/runconfigs.config ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/runconfigs.config @@ -0,0 +1,11 @@ +[default] +WAITON_setup +WAITON_genlib waiton setup +WAITON_test1 waiton genlib +WAITON_aggregate waiton test1 +WAITON_test2 waiton aggregate + +# [DEPS/SPEED] + +[std/0] + ADDED tests/dynamic-waiton-example/tests/aggregate/testconfig Index: tests/dynamic-waiton-example/tests/aggregate/testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/tests/aggregate/testconfig @@ -0,0 +1,2 @@ +[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] + ADDED tests/dynamic-waiton-example/tests/genlib/testconfig Index: tests/dynamic-waiton-example/tests/genlib/testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/tests/genlib/testconfig @@ -0,0 +1,5 @@ +[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] + +[itemstable] +VIEWTYPE layout schematic + ADDED tests/dynamic-waiton-example/tests/results/testconfig Index: tests/dynamic-waiton-example/tests/results/testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/tests/results/testconfig @@ -0,0 +1,2 @@ +[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] + ADDED tests/dynamic-waiton-example/tests/setup/testconfig Index: tests/dynamic-waiton-example/tests/setup/testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/tests/setup/testconfig @@ -0,0 +1,2 @@ +[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] + ADDED tests/dynamic-waiton-example/tests/test1/testconfig Index: tests/dynamic-waiton-example/tests/test1/testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/tests/test1/testconfig @@ -0,0 +1,3 @@ +[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] + +[include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] ADDED tests/dynamic-waiton-example/tests/test2/testconfig Index: tests/dynamic-waiton-example/tests/test2/testconfig ================================================================== --- /dev/null +++ tests/dynamic-waiton-example/tests/test2/testconfig @@ -0,0 +1,3 @@ +[include #{getenv MT_RUN_AREA_HOME}/common.testconfig] + +[include #{getenv MT_RUN_AREA_HOME}/common_itemstable.testconfig] ADDED tests/release/tests/dependencies/simpleresults.logpro Index: tests/release/tests/dependencies/simpleresults.logpro ================================================================== --- /dev/null +++ tests/release/tests/dependencies/simpleresults.logpro @@ -0,0 +1,110 @@ +;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com +;; +;; License GPL. + +(define logbody "LogFileBody") + +(define pass-specs '( ;; testname num-expected max-runtime + ("setup" 1 20) + ("test1/layout/ptran" 1 20) + ("test1/schematic/ptran" 1 20) + ("test2/layout/ptran" 1 20) + ("test2/schematic/ptran" 1 20) + )) + +(define fail-specs '( ;; testname num-expected max-runtime + )) + +(define warn-specs '()) + +(define nost-specs '( + )) + +(define (check-one-test estate estatus testname count runtime) + (let* ((rxe (regexp (conc "^\\s+Test: " testname "(\\(.*|\\s+)\\s+State: " estate "\\s+Status: " estatus "\\s+Runtime:\\s+(\\d+)s"))) + (msg1 (conc testname " expecting count of " count)) + (msg2 (conc testname " expecting runtime less than " runtime))) + (expect:required in logbody = count msg1 rxe) + ;;(expect:value in logbody count < msg2 rxe) + )) + +;; Special cases +;; +(expect:ignore in logbody >= 0 "db_sync test might not have run" #/Test: db_sync/) +(expect:ignore in logbody >= 0 "all_toplevel may not yet be done" #/Test: all_toplevel/) +(expect:error in logbody = 0 "tests left in RUNNING state" #/State: RUNNING/) +(expect:required in logbody = 1 "priority_2 is KILLED" #/Test: priority_2\s+State: KILLED\s+Status: KILLED/) +(expect:required in logbody = 1 "priority_5 is either PASS or SKIP" #/Test: priority_5\s+State: COMPLETED\s+Status: (SKIP|PASS)/) +(expect:required in logbody = 1 "priority_7 is either PASS or SKIP" #/Test: priority_7\s+State: COMPLETED\s+Status: (SKIP|PASS)/) +(expect:required in logbody = 1 "testxz has 1 NOT_STARTED test" #/Test: testxz\s+State: NOT_STARTED/) +(expect:required in logbody = 1 "no items" #/Test: no_items\s+State: NOT_STARTED\s+Status: ZERO_ITEMS/) +(expect:warning in logbody = 1 "dynamic waiton" #/Test: dynamic_waiton/) +(expect:required in logbody = 29 "blocktestxz has 29 tests" #/Test: blocktestxz/) + +;; General cases +;; +(for-each + (lambda (testdat) + (apply check-one-test "COMPLETED" "PASS" testdat)) + pass-specs) + +(for-each + (lambda (testdat) + (apply check-one-test "COMPLETED" "FAIL" testdat)) + fail-specs) + +(for-each + (lambda (testdat) + (apply check-one-test "COMPLETED" "WARN" testdat)) + warn-specs) + +(for-each + (lambda (testdat) + (apply check-one-test "NOT_STARTED" "PREQ_DISCARDED" testdat)) + nost-specs) + +;; Catch all. +;; +(expect:error in logbody = 0 "Tests not accounted for" #/Test: /) + + +;; ;; define your hooks +;; (hook:first-error "echo \"Error hook activated: #{escaped errmsg}\"") +;; (hook:first-warning "echo \"Got warning: #{escaped warnmsg}\"") +;; (hook:value "echo \"Value hook activated: expected=#{expected}, measured=#{measured}, tolerance=#{tolerance}, message=#{message}\"") +;; +;; ;; first ensure your run at least started +;; ;; +;; (trigger "Init" #/This is a header/) +;; (trigger "InitEnd" #/^\s*$/) +;; (section "Init" "Init" "InitEnd") +;; +;; (trigger "Body" #/^.*$/) ;; anything starts the body +;; ;; (trigger "EndBody" #/This had better never match/) +;; +;; (section "Body" "Body" "EndBody") +;; +;; (trigger "Blah2" #/^begin Blah2/) +;; (trigger "Blah2End" #/^end Blah2/) +;; (section "Blah2" "Blah2" "Blah2End") +;; +;; (expect:required in "Init" = 1 "Header" #/This is a header/) +;; (expect:required in "LogFileBody" > 0 "Something required but not found" #/This is required but not found/) +;; (expect:value in "LogFileBody" 1.9 0.1 "Output voltage" #/Measured voltage output:\s*([\d\.\+\-e]+)v/) +;; (expect:value in "LogFileBody" 0.5 0.1 "Output current" #/Measured output current:\s*([\d\.\+\-e]+)mA/) +;; (expect:value in "LogFileBody" 110e9 2e9 "A big number (first)" #/Freq:\s*([\d\.\+\-e]+)\s+Hz/) +;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (second), hook not called" #/Freq:\s*([\d\.\+\-e]+)Hz/) +;; (expect:value in "LogFileBody" 110e9 1e9 "A big number (never activated)" #/Freq:\s*([\d\.\+\-e]+)zH/) +;; +;; ;; Using match number +;; (expect:value in "LogFileBody" 1.9 0.1 "Time Voltage" #/out: (\d+)\s+(\d+)/ match: 2) +;; +;; ;; Comparison instead of tolerance +;; (expect:value in "LogFileBody" 1.9 > "Time voltage" #/out: (\d+)\s+(\d+)/ match: 2) +;; +;; (expect:ignore in "Blah2" < 99 "FALSE ERROR" #/ERROR/) +;; (expect:ignore in "Body" < 99 "Ignore the word error in comments" #/^\/\/.*error/) +;; (expect:warning in "Body" = 0 "Any warning" #/WARNING/) +;; (expect:error in "Body" = 0 "ERROR BLAH" (list #/ERROR/ #/error/)) ;; but disallow any other errors +;; +;; ;(expect in "Init" < 1 "Junk" #/This is bogus/) ADDED tests/release/tests/dependencies/testconfig Index: tests/release/tests/dependencies/testconfig ================================================================== --- /dev/null +++ tests/release/tests/dependencies/testconfig @@ -0,0 +1,12 @@ +# test2 from the tests/Makefile + +[var] +tname itemwait + +[ezsteps] + +# Set things up +cleansimple $MTRUNNER $MTTESTDIR/dep-tests $MTPATH megatest -remove-runs -testpatt % -target simple/0 -runname #{get var tname} +simple $MTRUNNER $MTTESTDIR/dep-tests $MTPATH megatest -run -testpatt test2/%/ptran -target simple/0 -runname #{get var tname} +simpleresults $MTRUNNER $MTTESTDIR/dep-tests $MTPATH megatest -list-runs #{get var name} -target simple/0 +