3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
12 # Quick tests for the sqlite3_analyzer tool
14 set testdir [file dirname $argv0]
15 source $testdir/tester.tcl
22 if {$tcl_platform(platform)=="windows"} {
23 set PROG "sqlite3_analyzer.exe"
25 set PROG "./sqlite3_analyzer"
27 if {![file exe $PROG]} {
28 set PROG [file normalize [file join $::cmdlinearg(TESTFIXTURE_HOME) $PROG]]
29 if {![file exe $PROG]} {
30 puts "analyzer1 cannot run because $PROG is not available"
36 forcedelete test.db test.db-journal test.db-wal
39 do_test analyzer1-1.0 {
41 CREATE TABLE t1(a INTEGER PRIMARY KEY, b);
42 CREATE TABLE t2(a INT PRIMARY KEY, b) WITHOUT ROWID;
43 WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<250)
44 INSERT INTO t1(a,b) SELECT x, randomblob(200) FROM c;
45 INSERT INTO t2(a,b) SELECT a, b FROM t1;
47 set line "exec $PROG test.db"
48 unset -nocomplain ::MSG
49 catch {eval $line} ::MSG
51 do_test analyzer1-1.1 {
52 regexp {^/\*\* Disk-Space Utilization.*COMMIT;\W*$} $::MSG