Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Update the documentation generator to keep track of historical requirement numbers and use that database to print the text of stale requirement numbers. |
---|---|
Downloads: | Tarball | ZIP archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA1: |
ec99d8206864a8cec7ed3b717177dd06 |
User & Date: | drh 2016-08-02 12:52:35.383 |
Context
2016-08-04
| ||
14:08 | Update the change log and add SQLITE_ENABLE_UNKNOWN_SQL_FUNCTION to the compile-time options documentation. (check-in: 88de905c03 user: drh tags: trunk) | |
2016-08-02
| ||
12:52 | Update the documentation generator to keep track of historical requirement numbers and use that database to print the text of stale requirement numbers. (check-in: ec99d82068 user: drh tags: trunk) | |
2016-07-28
| ||
19:26 | Updates to the 3.14 change log. (check-in: 6bc4912659 user: drh tags: trunk) | |
Changes
Changes to matrix.tcl.
︙ | ︙ | |||
12 13 14 15 16 17 18 19 20 21 22 23 24 25 | set filelist [lreplace $filelist $i $i] } # Initialize the database connection. # sqlite3 db docinfo.db db eval { BEGIN; DELETE FROM requirement; DELETE FROM reqsrc; } # Extract requirement text from all of the HTML files in $filelist # | > > > > > > > | 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | set filelist [lreplace $filelist $i $i] } # Initialize the database connection. # sqlite3 db docinfo.db db eval { ATTACH 'history.db' AS history; CREATE TABLE IF NOT EXISTS history.allreq( reqno TEXT PRIMARY KEY, -- Ex: R-12345-67890-... reqimage BOOLEAN, -- True for an image requirement reqtext TEXT, -- Normalized text of requirement or image filename srcfile TEXT -- Document from which extracted ); BEGIN; DELETE FROM requirement; DELETE FROM reqsrc; } # Extract requirement text from all of the HTML files in $filelist # |
︙ | ︙ | |||
85 86 87 88 89 90 91 92 93 94 95 96 97 98 | (reqno, reqtext, origtext, reqimage,srcfile,srcseq) VALUES($reqno,$req, $orig, 0, $srcfile,$seqno); } db eval { INSERT OR IGNORE INTO reqsrc(srcfile, srcseq, reqno) VALUES($srcfile, $seqno, $reqno) } set x $nx } set x $orig_x unset orig_x while {[string length $x]>0 && [regexp {^(.+?)(<img alt="syntax diagram .*)$} $x all prefix suffix]} { set x $suffix | > > > > | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 | (reqno, reqtext, origtext, reqimage,srcfile,srcseq) VALUES($reqno,$req, $orig, 0, $srcfile,$seqno); } db eval { INSERT OR IGNORE INTO reqsrc(srcfile, srcseq, reqno) VALUES($srcfile, $seqno, $reqno) } db eval { INSERT OR IGNORE INTO allreq(reqno,reqimage,reqtext,srcfile) VALUES($reqno,0,$req,$srcfile); } set x $nx } set x $orig_x unset orig_x while {[string length $x]>0 && [regexp {^(.+?)(<img alt="syntax diagram .*)$} $x all prefix suffix]} { set x $suffix |
︙ | ︙ | |||
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 | (reqno, reqtext, origtext, reqimage,srcfile,srcseq) VALUES($reqno,$req, $orig, 1, $srcfile,$seqno); } db eval { INSERT OR IGNORE INTO reqsrc(srcfile, srcseq, reqno) VALUES($srcfile,$seqno,$reqno) } } } } db eval COMMIT set cnt [db one {SELECT count(*) FROM requirement}] set evcnt [db one { SELECT count(*) FROM requirement WHERE reqno IN (SELECT reqno FROM evidence) }] set evpct [format {%.1f%%} [expr {$evcnt*100.0/$cnt}]] puts "\nFound $cnt testable statements. Evidence exists for $evcnt or $evpct" # Report all evidence for which there is no corresponding requirement. # Such evidence is probably "stale" - the requirement text has changed but # the evidence text did not. # db eval { SELECT reqno, srcfile, srcline FROM evidence WHERE reqno NOT IN (SELECT reqno FROM requirement) } { puts "ERROR: stale evidence at $srcfile:$srcline - $reqno" } ######################################################################## # Header output routine adapted from wrap.tcl. Keep the two in sync. # # hd_putsin4 is like puts except that it removes the first 4 indentation | > > > > > > > | 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 | (reqno, reqtext, origtext, reqimage,srcfile,srcseq) VALUES($reqno,$req, $orig, 1, $srcfile,$seqno); } db eval { INSERT OR IGNORE INTO reqsrc(srcfile, srcseq, reqno) VALUES($srcfile,$seqno,$reqno) } db eval { INSERT OR IGNORE INTO allreq(reqno, reqimage, reqtext, srcfile) VALUES($reqno,1,$req,$srcfile); } } } } db eval COMMIT set cnt [db one {SELECT count(*) FROM requirement}] set evcnt [db one { SELECT count(*) FROM requirement WHERE reqno IN (SELECT reqno FROM evidence) }] set evpct [format {%.1f%%} [expr {$evcnt*100.0/$cnt}]] puts "\nFound $cnt testable statements. Evidence exists for $evcnt or $evpct" # Report all evidence for which there is no corresponding requirement. # Such evidence is probably "stale" - the requirement text has changed but # the evidence text did not. # db eval { SELECT reqno, srcfile, srcline FROM evidence WHERE reqno NOT IN (SELECT reqno FROM requirement) } { puts "ERROR: stale evidence at $srcfile:$srcline - $reqno" db eval {SELECT reqtext FROM allreq WHERE reqno GLOB ($reqno||'*')} { puts "\"$reqtext\"" } } ######################################################################## # Header output routine adapted from wrap.tcl. Keep the two in sync. # # hd_putsin4 is like puts except that it removes the first 4 indentation |
︙ | ︙ |
Changes to wrap.tcl.
︙ | ︙ | |||
41 42 43 44 45 46 47 48 49 50 51 52 53 54 | source [file dirname [info script]]/pages/fancyformat.tcl # Open the SQLite database. # sqlite3 db docinfo.db db eval { BEGIN; DELETE FROM link; DELETE FROM keyword; DELETE FROM fragment; DELETE FROM page; } | > | 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | source [file dirname [info script]]/pages/fancyformat.tcl # Open the SQLite database. # sqlite3 db docinfo.db db eval { ATTACH 'history.db' AS history; BEGIN; DELETE FROM link; DELETE FROM keyword; DELETE FROM fragment; DELETE FROM page; } |
︙ | ︙ |