Index: docs/manual/megatest_manual.html ================================================================== --- docs/manual/megatest_manual.html +++ docs/manual/megatest_manual.html @@ -1306,10 +1306,21 @@

Ezsteps

+
+
Example ezsteps with logpro rules
+
+
[ezsteps]
+lookittmp   ls /tmp
+
+[logpro]
+lookittmp ;; Note: config file format supports multi-line entries where leading whitespace is removed from each line
+  ;;     a blank line indicates the end of the block of text
+  (expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/)
+

To transfer the environment to the next step you can do the following:

$MT_MEGATEST -env2file .ezsteps/${stepname}
Index: docs/manual/reference.txt ================================================================== --- docs/manual/reference.txt +++ docs/manual/reference.txt @@ -223,10 +223,22 @@ # logpro diff %file1% %file2% | logpro %waivername%.logpro %waivername%.html ----------------- Ezsteps ~~~~~~~ + +.Example ezsteps with logpro rules +----------------- +[ezsteps] +lookittmp ls /tmp + +[logpro] +lookittmp ;; Note: config file format supports multi-line entries where leading whitespace is removed from each line + ;; a blank line indicates the end of the block of text + (expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/) + +----------------- To transfer the environment to the next step you can do the following: ---------------------------- $MT_MEGATEST -env2file .ezsteps/${stepname} Index: docs/manual/server.png ================================================================== --- docs/manual/server.png +++ docs/manual/server.png cannot compute difference between binary files Index: launch.scm ================================================================== --- launch.scm +++ launch.scm @@ -53,20 +53,32 @@ (if enccmd (common:read-encoded-string enccmd) '()))) -(define (launch:runstep ezstep run-id test-id exit-info m tal) - (let* ((stepname (car ezstep)) ;; do stuff to run the step - (stepinfo (cadr ezstep)) - (stepparts (string-match (regexp "^(\\{([^\\}]*)\\}\\s*|)(.*)$") stepinfo)) - (stepparms (list-ref stepparts 2)) ;; for future use, {VAR=1,2,3}, run step for each - (stepcmd (list-ref stepparts 3)) - (script "") ; "#!/bin/bash\n") ;; yep, we depend on bin/bash FIXME!!!\ - (logpro-file (conc stepname ".logpro")) - (html-file (conc stepname ".html")) - (logpro-used (file-exists? logpro-file))) +(define (launch:runstep ezstep run-id test-id exit-info m tal testconfig) + (let* ((stepname (car ezstep)) ;; do stuff to run the step + (stepinfo (cadr ezstep)) + (stepparts (string-match (regexp "^(\\{([^\\}]*)\\}\\s*|)(.*)$") stepinfo)) + (stepparms (list-ref stepparts 2)) ;; for future use, {VAR=1,2,3}, run step for each + (stepcmd (list-ref stepparts 3)) + (script "") ; "#!/bin/bash\n") ;; yep, we depend on bin/bash FIXME!!!\ + (logpro-file (conc stepname ".logpro")) + (html-file (conc stepname ".html")) + (tconfig-logpro (configf:lookup testconfig "logpro" stepname)) + (logpro-used (file-exists? logpro-file))) + + (if (and tconfig-logpro + (not logpro-used)) ;; no logpro file found but have a defn in the testconfig + (begin + (with-output-to-file logpro-file + (lambda () + (print ";; logpro file extracted from testconfig\n" + ";;") + (print tconfig-logpro))) + (set! logpro-used #t))) + ;; NB// can safely assume we are in test-area directory (debug:print 4 "ezsteps:\n stepname: " stepname " stepinfo: " stepinfo " stepparts: " stepparts " stepparms: " stepparms " stepcmd: " stepcmd) ;; ;; first source the previous environment @@ -355,11 +367,11 @@ (let loop ((ezstep (car ezstepslst)) (tal (cdr ezstepslst)) (prevstep #f)) ;; check exit-info (vector-ref exit-info 1) (if (vector-ref exit-info 1) - (let ((logpro-used (launch:runstep ezstep run-id test-id exit-info m tal))) + (let ((logpro-used (launch:runstep ezstep run-id test-id exit-info m tal testconfig))) (if (and (steprun-good? logpro-used (vector-ref exit-info 2)) (not (null? tal))) (loop (car tal) (cdr tal) stepname))) (debug:print 4 "WARNING: a prior step failed, stopping at " ezstep)))))))) (monitorjob (lambda () DELETED tests/fullrun/tests/logpro_required_fail/lookittmp.logpro Index: tests/fullrun/tests/logpro_required_fail/lookittmp.logpro ================================================================== --- tests/fullrun/tests/logpro_required_fail/lookittmp.logpro +++ /dev/null @@ -1,8 +0,0 @@ -;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com -;; -;; License GPL. - -(expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/) - -;; (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) -;; (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; force an error Index: tests/fullrun/tests/logpro_required_fail/testconfig ================================================================== --- tests/fullrun/tests/logpro_required_fail/testconfig +++ tests/fullrun/tests/logpro_required_fail/testconfig @@ -5,8 +5,19 @@ [test_meta] author matt owner bob description This test runs two ezstep, the first of which is expected to fail using a simple logpro file. + +[logpro] +lookittmp ;; (c) 2006,2007,2008,2009 Matthew Welland matt@kiatoa.com + ;; + ;; License GPL. + ;; + (expect:required in "LogFileBody" > 0 "A file name that should never exist!" #/This is a awfully stupid file name that should never be found in the temp dir/) + ;; + ;; (expect:warning in "LogFileBody" = 0 "Any warning" #/WARNING/) + ;; (expect:error in "LogFileBody" = 0 "Any error" (list #/ERROR/ #/.*/)) ;; force an error + tags logpro reviewed 09/10/2011, by Matt