sqllogictest

Check-in [a9ccd7d797]
Login

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.010
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
Unified Diff Ignore Whitespace Patch
Added src/run-all.tcl.


















































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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
55
56
57
#!/usr/bin/tclsh
#
# Run this script in the "src" subdirectory of sqllogictest, after first
# compiling the ./sqllogictest binary, in order to verify correct output
# of all historical test cases.
#

set starttime [clock seconds]

if {$tcl_platform(platform)=="unix"} {
  set BIN ./sqllogictest
} else {
  set BIN ./sqllogictest.exe
}
if {![file exec $BIN]} {
  error "$BIN does not exist or is not executable.  Run make."
}

# add all test case file in the $subdir subdirectory to the
# set of all test case files in the global tcase() array.
#
proc search_for_test_cases {subdir} {
  foreach nx [glob -nocomplain $subdir/*] {
    if {[file isdir $nx]} {
      search_for_test_cases $nx
    } elseif {[string match *.test $nx]} {
      set ::tcase($nx) 1
    }
  }
}
search_for_test_cases ../test

# Run the tests
#
set totalerr 0
set totaltest 0
set totalrun 0
foreach tx [lsort [array names tcase]] {
  foreach opt {0 1023} {
    catch {
      exec $BIN -verify -parameter optimizer=$opt $tx
    } res
    puts $res
    if {[regexp {(\d+) errors out of (\d+) tests} $res all nerr ntst]} {
      incr totalerr $nerr
      incr totaltest $ntst
    } else {
      error "test did not complete: $BIN -verify -parameter optimizer=$opt $tx"
    }
    incr totalrun
  }
}

set endtime [clock seconds]
set totaltime [expr {$endtime - $starttime}]
puts "$totalerr errors out of $totaltest tests and $totalrun invocations\
      in $totaltime seconds"