Overview
Comment: | Partial implementation of loading arbitrary test data |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
dd5766961ce96109590a97c4046ae82a |
User & Date: | matt on 2011-09-05 22:34:14 |
Other Links: | manifest | tags |
Context
2011-09-05
| ||
22:49 | Completed loading arbitrary test data check-in: 9bc4b32214 user: matt tags: trunk | |
22:34 | Partial implementation of loading arbitrary test data check-in: dd5766961c user: matt tags: trunk | |
17:11 | completed rollup and updated remove-runs to preserve test runs where there are still references in the db check-in: 94a65715c9 user: matt tags: trunk | |
Changes
Modified common.scm from [361ea4a752] to [3897afab0f].
1 2 3 4 5 6 7 8 9 10 11 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 | - + | ;;====================================================================== ;; Copyright 2006-2011, Matthew Welland. ;; ;; This program is made available under the GNU GPL version 2.0 or ;; greater. See the accompanying file COPYING for details. ;; ;; This program is distributed WITHOUT ANY WARRANTY; without even the ;; implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR ;; PURPOSE. ;;====================================================================== |
︙ |
Modified db.scm from [8d79c7b2db] to [8af0a21b47].
︙ | |||
22 23 24 25 26 27 28 | 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | - + - + - + | (sqlite3:set-busy-handler! db handler) (if (not dbexists) (let* ((keys (config-get-fields configdat)) (havekeys (> (length keys) 0)) (keystr (keys->keystr keys)) (fieldstr (keys->key/field keys))) ;; (sqlite3:execute db "PRAGMA synchronous = OFF;") |
︙ | |||
64 65 66 67 68 69 70 | 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 | - + - - - + + + - + - - + + - + + + + + + + + + + + + - + - - - - - - - - - - + + + + + + + + + + + + + + + + + - + | event_time TIMESTAMP, fail_count INTEGER DEFAULT 0, pass_count INTEGER DEFAULT 0, CONSTRAINT testsconstraint UNIQUE (run_id, testname, item_path) );") (sqlite3:execute db "CREATE INDEX tests_index ON tests (run_id, testname);") (sqlite3:execute db "CREATE VIEW runs_tests AS SELECT * FROM runs INNER JOIN tests ON runs.id=tests.run_id;") |
︙ | |||
441 442 443 444 445 446 447 | 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 | + + + + + + + + + + + + + + + + + + + + + + + + - + | (sqlite3:execute db "INSERT OR IGNORE INTO test_meta (testname,author,owner,description,reviewed,iterated,avg_runtime,avg_disk,tags) VALUES (?,'','','','','','','','');" testname)) ;; update one of the testmeta fields (define (db:testmeta-update-field db testname field value) (sqlite3:execute db (conc "UPDATE test_meta SET " field "=? WHERE testname=?;") value testname)) ;;====================================================================== ;; T E S T D A T A ;;====================================================================== (define (db:csv->testdata db test-id csvdata) (let ((csvlist (csv->list csvdata))) (for-each (lambda (csvrow) (apply sqlite3:execute db "INSERT OR REPLACE INTO test_data (test_id,category,variable,value,comment) VALUES (?,?,?,?,?);" test-id (take (append csvrow '("" "" "" "")) 4))) csvlist))) (define (db:load-test-data db run-id test-name itemdat) (let* ((item-path (item-list->path itemdat)) (testdat (db:get-test-info db run-id test-name item-path)) (test-id (db:test-get-id testdat))) (debug:print 1 "Enter records to insert in the test_data table, four fields, comma separated per line") (debug:print 4 "itemdat: " itemdat ", test-name: " test-name ", test-id: " test-id) (let loop ((lin (read-line))) (if (not (eof-object? lin)) (begin (debug:print 4 lin) (db:csv->testdata db test-id lin) (loop (read-line))))))) ;;====================================================================== |
︙ |
Modified megatest-version.scm from [47e03ef807] to [0e4590aa3f].
1 2 | 1 2 3 | - + | ;; Always use two digit decimal ;; 1.01, 1.02...1.10,1.11 ... 1.99,2.00.. |
Modified megatest.scm from [6417d3c92b] to [94499f5a91].
︙ | |||
44 45 46 47 48 49 50 51 52 53 54 55 56 57 | 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | + + + + + | :value : value measured :expected_value : value expected :tol : |value-expect| <= tol :units : name of the units for value, expected_value and tol :first_err : record an error message :first_warn : record a warning message Arbitrary test data loading -load-test-data : read test specific data for storage in the test_data table from standard in. Each line is comma delimited with four fields category,variable,value,comment Queries -list-runs patt : list runs matching pattern \"patt\", % is the wildcard -testpatt patt : in list-runs show only these tests, % is the wildcard -itempatt patt : in list-runs show only tests with items that match patt -showkeys : show the keys used in this megatest setup Misc |
︙ | |||
118 119 120 121 122 123 124 125 126 127 128 129 130 131 | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | + | ) (list "-h" "-force" "-xterm" "-showkeys" "-test-status" "-set-values" "-load-test-data" "-summarize-items" "-gui" "-runall" ;; run all tests "-remove-runs" "-keepgoing" "-usequeue" "-rebuild-db" |
︙ | |||
557 558 559 560 561 562 563 564 565 566 567 568 569 570 | 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 | + | (sqlite3:finalize! db) (set! *didsomething* #t)))) (if (or (args:get-arg "-setlog") ;; since setting up is so costly lets piggyback on -test-status (args:get-arg "-set-toplog") (args:get-arg "-test-status") (args:get-arg "-set-values") (args:get-arg "-load-test-data") (args:get-arg "-runstep") (args:get-arg "-summarize-items")) (if (not (getenv "MT_CMDINFO")) (begin (debug:print 0 "ERROR: MT_CMDINFO env var not set, commands -test-status, -runstep and -setlog must be called *inside* a megatest environment!") (exit 5)) (let* ((startingdir (current-directory)) |
︙ | |||
580 581 582 583 584 585 586 587 588 589 590 591 592 593 | 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 | + + | (status (args:get-arg ":status"))) (change-directory testpath) (if (not (setup-for-run)) (begin (debug:print 0 "Failed to setup, exiting") (exit 1))) (set! db (open-db)) (if (args:get-arg "-load-test-data") (db:load-test-data db run-id test-name itemdat)) (if (args:get-arg "-setlog") (test-set-log! db run-id test-name itemdat (args:get-arg "-setlog"))) (if (args:get-arg "-set-toplog") (test-set-toplog! db run-id test-name (args:get-arg "-set-toplog"))) (if (args:get-arg "-summarize-items") (tests:summarize-items db run-id test-name #t)) ;; do force here (if (args:get-arg "-runstep") |
︙ |
Modified utils/installall.sh from [0ace91fc09] to [7a7c1d6a7f].
︙ | |||
62 63 64 65 66 67 68 | 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | - + | tar xfvz chicken-${CHICKEN_VERSION}.tar.gz cd chicken-${CHICKEN_VERSION} make PLATFORM=linux PREFIX=$PREFIX make PLATFORM=linux PREFIX=$PREFIX install cd $BUILDHOME fi |
︙ |