Check-in [5c2e1f9b03]
Not logged in
Overview
SHA1 Hash:5c2e1f9b039d347d1434eb0fadde58a7161b0fa8
Date: 2012-04-21 23:32:42
User: matt
Comment:Migrating from -test-paths to -test-path
Timelines: family | ancestors | descendants | both | extend-test-get-path
Diffs: root of this branch
Downloads: Tarball | ZIP archive
Other Links: files | file ages | manifest
Tags And Properties
Changes

Modified megatest.scm from [22a45f314b9b40a9] to [a58a41b84eb4adbf].

78 -load-test-data : read test specific data for storage in the test_data 78 -load-test-data : read test specific data for storage in the test_data 79 from standard in. Each line is comma delimited with 79 from standard in. Each line is comma delimited with 80 fields category,variable,value,comment 80 fields category,variable,value,comment 81 81 82 Queries 82 Queries 83 -list-runs patt : list runs matching pattern \"patt\", % is the wildca 83 -list-runs patt : list runs matching pattern \"patt\", % is the wildca 84 -showkeys : show the keys used in this megatest setup 84 -showkeys : show the keys used in this megatest setup 85 -test-paths targpatt : get the most recent test path(s) matching targpatt e | 85 -test-path targpatt : get the most recent test path(s) matching targpatt e. 86 returns list sorted by age ascending, see examples b 86 returns list sorted by age ascending, see examples b 87 87 88 Misc 88 Misc 89 -rebuild-db : bring the database schema up to date 89 -rebuild-db : bring the database schema up to date 90 -update-meta : update the tests metadata for all tests 90 -update-meta : update the tests metadata for all tests 91 -env2file fname : write the environment to fname.csh and fname.sh 91 -env2file fname : write the environment to fname.csh and fname.sh 92 -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these a 92 -setvars VAR1=val1,VAR2=val2 : Add environment variables to a run NB// these a ................................................................................................................................................................................ 98 Spreadsheet generation 98 Spreadsheet generation 99 -extract-ods fname.ods : extract an open document spreadsheet from the databa 99 -extract-ods fname.ods : extract an open document spreadsheet from the databa 100 -pathmod path : insert path, i.e. path/runame/itempath/logfile.html 100 -pathmod path : insert path, i.e. path/runame/itempath/logfile.html 101 will clear the field if no rundir/testname/itempath/ 101 will clear the field if no rundir/testname/itempath/ 102 if it contains forward slashes the path will be conv 102 if it contains forward slashes the path will be conv 103 to windows style 103 to windows style 104 104 105 Helpers (these only apply in test run mode) < 106 < 107 Examples 105 Examples 108 106 109 # Get test paths | 107 # Get test path, the '.' is required, could use '*' or a specific path/file 110 megatest -test-paths -target ubuntu/n%/no% :runname w49% -testpatt test_mt% | 108 megatest -test-path . -target ubuntu/n%/no% :runname w49% -testpatt test_mt% 111 109 112 Called as " (string-intersperse (argv) " "))) 110 Called as " (string-intersperse (argv) " "))) 113 111 114 ;; -gui : start a gui interface 112 ;; -gui : start a gui interface 115 ;; -config fname : override the runconfig file with fname 113 ;; -config fname : override the runconfig file with fname 116 114 117 ;; process args 115 ;; process args ................................................................................................................................................................................ 169 ;; misc 167 ;; misc 170 "-archive" 168 "-archive" 171 "-repl" 169 "-repl" 172 "-lock" 170 "-lock" 173 "-unlock" 171 "-unlock" 174 ;; queries 172 ;; queries 175 "-test-paths" ;; get path(s) to a test, ordered by young 173 "-test-paths" ;; get path(s) to a test, ordered by young > 174 "-test-path" ;; -test-paths is deprecated 176 175 177 "-runall" ;; run all tests 176 "-runall" ;; run all tests 178 "-remove-runs" 177 "-remove-runs" 179 "-usequeue" 178 "-usequeue" 180 "-rebuild-db" 179 "-rebuild-db" 181 "-rollup" 180 "-rollup" 182 "-update-meta" 181 "-update-meta" ................................................................................................................................................................................ 444 (args:get-arg "-unlock") 443 (args:get-arg "-unlock") 445 user)))) 444 user)))) 446 445 447 ;;====================================================================== 446 ;;====================================================================== 448 ;; Get paths to tests 447 ;; Get paths to tests 449 ;;====================================================================== 448 ;;====================================================================== 450 ;; Get test paths matching target, runname, testpatt, and itempatt 449 ;; Get test paths matching target, runname, testpatt, and itempatt 451 (if (args:get-arg "-test-paths") | 450 (if (or (args:get-arg "-test-path")(args:get-arg "-test-paths")) 452 ;; if we are in a test use the MT_CMDINFO data 451 ;; if we are in a test use the MT_CMDINFO data 453 (if (getenv "MT_CMDINFO") 452 (if (getenv "MT_CMDINFO") 454 (let* ((startingdir (current-directory)) 453 (let* ((startingdir (current-directory)) 455 (cmdinfo (read (open-input-string (base64:base64-decode (getenv 454 (cmdinfo (read (open-input-string (base64:base64-decode (getenv 456 (testpath (assoc/default 'testpath cmdinfo)) 455 (testpath (assoc/default 'testpath cmdinfo)) 457 (test-name (assoc/default 'test-name cmdinfo)) 456 (test-name (assoc/default 'test-name cmdinfo)) 458 (runscript (assoc/default 'runscript cmdinfo)) 457 (runscript (assoc/default 'runscript cmdinfo)) ................................................................................................................................................................................ 466 (change-directory testpath) 465 (change-directory testpath) 467 (if (not target) 466 (if (not target) 468 (begin 467 (begin 469 (debug:print 0 "ERROR: -target is required.") 468 (debug:print 0 "ERROR: -target is required.") 470 (exit 1))) 469 (exit 1))) 471 (if (not (setup-for-run)) 470 (if (not (setup-for-run)) 472 (begin 471 (begin 473 (debug:print 0 "Failed to setup, giving up on -test-paths, exiti | 472 (debug:print 0 "Failed to setup, giving up on -test-path, exitin 474 (exit 1))) 473 (exit 1))) 475 (set! db (open-db)) 474 (set! db (open-db)) 476 (if (not (args:get-arg "-server")) 475 (if (not (args:get-arg "-server")) 477 (server:client-setup db)) 476 (server:client-setup db)) 478 (let* ((itempatt (args:get-arg "-itempatt")) 477 (let* ((itempatt (args:get-arg "-itempatt")) 479 (keys (rdb:get-keys db)) 478 (keys (rdb:get-keys db)) 480 (keynames (map key:get-fieldname keys)) 479 (keynames (map key:get-fieldname keys)) ................................................................................................................................................................................ 481 (paths (rdb:test-get-paths-matching db keynames target))) 480 (paths (rdb:test-get-paths-matching db keynames target))) 482 (set! *didsomething* #t) 481 (set! *didsomething* #t) 483 (for-each (lambda (path) 482 (for-each (lambda (path) 484 (print path)) 483 (print path)) 485 paths))) 484 paths))) 486 ;; else do a general-run-call 485 ;; else do a general-run-call 487 (general-run-call 486 (general-run-call 488 "-test-paths" | 487 "-test-path" 489 "Get paths to tests" | 488 "Get paths to test" 490 (lambda (db target runname keys keynames keyvallst) 489 (lambda (db target runname keys keynames keyvallst) 491 (let* ((itempatt (args:get-arg "-itempatt")) 490 (let* ((itempatt (args:get-arg "-itempatt")) 492 (paths (rdb:test-get-paths-matching db keynames target))) 491 (paths (rdb:test-get-paths-matching db keynames target))) 493 (for-each (lambda (path) 492 (for-each (lambda (path) 494 (print path)) 493 (print path)) 495 paths)))))) 494 paths)))))) 496 495