Index: docs/megatest.lyx ================================================================== --- docs/megatest.lyx +++ docs/megatest.lyx @@ -818,10 +818,19 @@ \end_inset \end_layout + +\begin_layout Section +Choose Flow or Unstructured Run? +\end_layout + +\begin_layout Standard +A flow is a structured and specifically sequenced set of tests. + See the Flows chapter to understand the difference. +\end_layout \begin_layout Section How to Write Tests \end_layout @@ -1521,10 +1530,146 @@ \begin_layout Standard You can optionally specify the keys for your database to limit further the runs to extract into the spreadsheet. The first sheet contains all the run data and subsequent sheets contain data rolled up for the individual tests. +\end_layout + +\begin_layout Section +Flows +\end_layout + +\begin_layout Standard +A flow specifies the tests to run, the order and dependencies and is managed + by a running megatest process. +\end_layout + +\begin_layout Section +Flow Specification and Running +\end_layout + +\begin_layout Subsection +Write your flow file +\end_layout + +\begin_layout Standard +flows/.config +\end_layout + +\begin_layout Standard +\begin_inset listings +inline false +status open + +\begin_layout Plain Layout + +# Flow: +\end_layout + +\begin_layout Plain Layout + +[flowconfig] +\end_layout + +\begin_layout Plain Layout + +# turn on item level dependencies +\end_layout + +\begin_layout Plain Layout + +itemdeps on +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +[flowsteps] +\end_layout + +\begin_layout Plain Layout + +# [,] +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +# Run the test "copydata" +\end_layout + +\begin_layout Plain Layout + +copydata +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +# Run the test "setup" after copydata completes with PASS, WARN or WAIVE +\end_layout + +\begin_layout Plain Layout + +setup,copydata +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout + +# once the test "setup" completes successfully run sim1, sim2 and sim3 +\end_layout + +\begin_layout Plain Layout + +sim1,setup +\end_layout + +\begin_layout Plain Layout + +sim2,setup +\end_layout + +\begin_layout Plain Layout + +sim3,setup +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsection +Run the flow +\end_layout + +\begin_layout Standard +\begin_inset listings +inline false +status open + +\begin_layout Plain Layout + +megatest -runflow :FIELD1 val1 :FIELD2 val2 :runname wk32.4 +\end_layout + +\end_inset + + \end_layout \begin_layout Section Reference \end_layout ADDED run_records.scm Index: run_records.scm ================================================================== --- /dev/null +++ run_records.scm @@ -0,0 +1,13 @@ +(define-inline (test:get-id vec) (vector-ref vec 0)) +(define-inline (test:get-run_id vec) (vector-ref vec 1)) +(define-inline (test:get-test-name vec)(vector-ref vec 2)) +(define-inline (test:get-state vec) (vector-ref vec 3)) +(define-inline (test:get-status vec) (vector-ref vec 4)) +(define-inline (test:get-item-path vec)(vector-ref vec 5)) + +(define-inline (test:test-get-fullname test) + (conc (db:test-get-testname test) + (if (equal? (db:test-get-item-path test) "") + "" + (conc "(" (db:test-get-item-path test) ")")))) + ADDED tests/vectors-vs-records.scm Index: tests/vectors-vs-records.scm ================================================================== --- /dev/null +++ tests/vectors-vs-records.scm @@ -0,0 +1,37 @@ +(use srfi-9) + +(define numtodo (string->number (caddr (argv)))) + +;; using vectors +(define testvalvec (vector 0 1 2 3 4 5)) +(define-inline (testing:get-first vec )(vector-ref vec 0)) +(define-inline (testing:get-count vec )(vector-ref vec 5)) +(define-inline (testing:set-first! vec val)(vector-set! vec 0 val)) +(define-inline (testing:set-count! vec val)(vector-set! vec 5 val)) + +(if (equal? (cadr (argv)) "vectors") + (begin + (print "Testing " numtodo " vectors") + (let loop ((i 0)) + (testing:set-count! testvalvec i) + (testing:set-first! testvalvec (testing:get-count testvalvec)) + (if (< i numtodo) + (loop (+ i 1)))))) + +;; using records +(define-record-type testing + (make-testing zeroeth first second third fourth count) + testing? + (count get:count set:count) + (first get:first set:first)) + +(define testvalrec (make-testing 0 1 2 3 4 5)) + +(if (equal? (cadr (argv)) "records") + (begin + (print "Testing " numtodo " records") + (let loop ((i 0)) + (set:count testvalrec i) + (set:first testvalrec (get:count testvalrec)) + (if (< i numtodo) + (loop (+ i 1))))))