sqllogictest
Check-in [a9ccd7d797]
Not logged in

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add the "run-all.tcl" script that runs all --verify tests and summarizes the output, and that works on both unix and windows.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a9ccd7d797b1ed45eb830db5a58cf5da27805e79
User & Date: drh 2015-07-24 00:37:09
Context
2015-09-11
20:54
Fix evidence marks due to wording changes. check-in: 62245fe6d0 user: drh tags: trunk
2015-07-24
00:37
Add the "run-all.tcl" script that runs all --verify tests and summarizes the output, and that works on both unix and windows. check-in: a9ccd7d797 user: drh tags: trunk
00:03
Update the built-in SQLite to the second 3.8.11 beta. check-in: ac688c398e user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Added src/run-all.tcl.

            1  +#!/usr/bin/tclsh
            2  +#
            3  +# Run this script in the "src" subdirectory of sqllogictest, after first
            4  +# compiling the ./sqllogictest binary, in order to verify correct output
            5  +# of all historical test cases.
            6  +#
            7  +
            8  +set starttime [clock seconds]
            9  +
           10  +if {$tcl_platform(platform)=="unix"} {
           11  +  set BIN ./sqllogictest
           12  +} else {
           13  +  set BIN ./sqllogictest.exe
           14  +}
           15  +if {![file exec $BIN]} {
           16  +  error "$BIN does not exist or is not executable.  Run make."
           17  +}
           18  +
           19  +# add all test case file in the $subdir subdirectory to the
           20  +# set of all test case files in the global tcase() array.
           21  +#
           22  +proc search_for_test_cases {subdir} {
           23  +  foreach nx [glob -nocomplain $subdir/*] {
           24  +    if {[file isdir $nx]} {
           25  +      search_for_test_cases $nx
           26  +    } elseif {[string match *.test $nx]} {
           27  +      set ::tcase($nx) 1
           28  +    }
           29  +  }
           30  +}
           31  +search_for_test_cases ../test
           32  +
           33  +# Run the tests
           34  +#
           35  +set totalerr 0
           36  +set totaltest 0
           37  +set totalrun 0
           38  +foreach tx [lsort [array names tcase]] {
           39  +  foreach opt {0 1023} {
           40  +    catch {
           41  +      exec $BIN -verify -parameter optimizer=$opt $tx
           42  +    } res
           43  +    puts $res
           44  +    if {[regexp {(\d+) errors out of (\d+) tests} $res all nerr ntst]} {
           45  +      incr totalerr $nerr
           46  +      incr totaltest $ntst
           47  +    } else {
           48  +      error "test did not complete: $BIN -verify -parameter optimizer=$opt $tx"
           49  +    }
           50  +    incr totalrun
           51  +  }
           52  +}
           53  +
           54  +set endtime [clock seconds]
           55  +set totaltime [expr {$endtime - $starttime}]
           56  +puts "$totalerr errors out of $totaltest tests and $totalrun invocations\
           57  +      in $totaltime seconds"