/ Check-in [f9423993]
Login

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

Overview
Comment:Updated omittest.tcl. Updated OMIT list. Updated for Windows. (CVS 5510)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f94239933e6f93d9780178b6f9a6b14ca791716a
User & Date: shane 2008-07-31 02:43:35
Context
2008-07-31
14:47
Documentation updates. (CVS 5511) check-in: e7fdd813 user: drh tags: trunk
02:43
Updated omittest.tcl. Updated OMIT list. Updated for Windows. (CVS 5510) check-in: f9423993 user: shane tags: trunk
02:05
Omit calls to test_get_table_printf() if SQLITE_OMIT_GET_TABLE defined. (CVS 5509) check-in: 524a4075 user: shane tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tool/omittest.tcl.

1
2
3
4
5
6
7
8
9
..
43
44
45
46
47
48
49
50





51
52
53
54
55
56
57
58
59


60
61
62
63
64
65
66
67
68
69
70
71
72




73
74
75
76
77
78
79
80
81
..
92
93
94
95
96
97
98



99

100
101
102
103
104
105
106
...
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
...
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176

set rcsid {$Id: omittest.tcl,v 1.4 2008/06/26 10:41:19 danielk1977 Exp $}

# Documentation for this script. This may be output to stderr
# if the script is invoked incorrectly.
set ::USAGE_MESSAGE {
This Tcl script is used to test the various compile time options 
available for omitting code (the SQLITE_OMIT_xxx options). It
should be invoked as follows:
................................................................................
# when doing so. For example:
#
#     run_quick_test /tmp/testdir {SQLITE_OMIT_TRIGGER SQLITE_OMIT_VIEW}
#
#
proc run_quick_test {dir omit_symbol_list} {
  # Compile the value of the OPTS Makefile variable.
  set opts "-DSQLITE_MEMDEBUG=2 -DSQLITE_DEBUG -DSQLITE_OS_UNIX" 





  foreach sym $omit_symbol_list {
    append opts " -D${sym}=1"
  }

  # Create the directory and do the build. If an error occurs return
  # early without attempting to run the test suite.
  file mkdir $dir
  puts -nonewline "Building $dir..."
  flush stdout


  set rc [catch {
    exec make -C $dir -f $::MAKEFILE testfixture OPTS=$opts >& $dir/build.log
  }]
  if {$rc} {
    puts "No good. See $dir/build.log."
    return
  } else {
    puts "Ok"
  }
  
  # Create an empty file "$dir/sqlite3". This is to trick the makefile out 
  # of trying to build the sqlite shell. The sqlite shell won't build 
  # with some of the OMIT options (i.e OMIT_COMPLETE).




  if {![file exists $dir/sqlite3]} {
    set wr [open $dir/sqlite3 w]
    puts $wr "dummy"
    close $wr
  }

  # Run the test suite.
  puts -nonewline "Testing $dir..."
  flush stdout
................................................................................

# This proc processes the command line options passed to this script.
# Currently the only option supported is "-makefile", default
# "../Makefile.linux-gcc". Set the ::MAKEFILE variable to the value of this
# option.
#
proc process_options {argv} {



  set ::MAKEFILE ../Makefile.linux-gcc              ;# Default value

  for {set i 0} {$i < [llength $argv]} {incr i} {
    switch -- [lindex $argv $i] {
      -makefile {
        incr i
        set ::MAKEFILE [lindex $argv $i]
      }
  
................................................................................
# Main routine.
#

proc main {argv} {
  # List of SQLITE_OMIT_XXX symbols supported by SQLite.
  set ::SYMBOLS [list                  \
    SQLITE_OMIT_ALTERTABLE             \


    SQLITE_OMIT_AUTHORIZATION          \
    SQLITE_OMIT_AUTOINCREMENT          \

    SQLITE_OMIT_AUTOVACUUM             \

    SQLITE_OMIT_BLOB_LITERAL           \



    SQLITE_OMIT_COMPLETE               \
    SQLITE_OMIT_COMPOUND_SELECT        \
    SQLITE_OMIT_CONFLICT_CLAUSE        \
    SQLITE_OMIT_DATETIME_FUNCS         \


    SQLITE_OMIT_EXPLAIN                \

    SQLITE_OMIT_FLOATING_POINT         \
    SQLITE_OMIT_FOREIGN_KEY            \


    SQLITE_OMIT_INCRBLOB               \
    SQLITE_OMIT_INTEGRITY_CHECK        \



    SQLITE_OMIT_MEMORYDB               \

    SQLITE_OMIT_PAGER_PRAGMAS          \

    SQLITE_OMIT_PRAGMA                 \
    SQLITE_OMIT_PROGRESS_CALLBACK      \

    SQLITE_OMIT_REINDEX                \
    SQLITE_OMIT_SCHEMA_PRAGMAS         \
    SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS \

    SQLITE_OMIT_SUBQUERY               \
    SQLITE_OMIT_TCL_VARIABLE           \


    SQLITE_OMIT_TRIGGER                \
    SQLITE_OMIT_UTF16                  \
    SQLITE_OMIT_VACUUM                 \
    SQLITE_OMIT_VIEW                   \
    SQLITE_OMIT_VIRTUALTABLE           \

  ]

  # Process any command line options.
  process_options $argv
  
  # First try a test with all OMIT symbols except SQLITE_OMIT_FLOATING_POINT 
  # and SQLITE_OMIT_PRAGMA defined. The former doesn't work (causes segfaults)
................................................................................
  set allsyms [list]
  foreach s $::SYMBOLS {
    if {$s!="SQLITE_OMIT_FLOATING_POINT" && $s!="SQLITE_OMIT_PRAGMA"} {
      lappend allsyms $s
    }
  }
  run_quick_test test_OMIT_EVERYTHING $allsyms
  
  # Now try one quick.test with each of the OMIT symbols defined. Included
  # are the OMIT_FLOATING_POINT and OMIT_PRAGMA symbols, even though we
  # know they will fail. It's good to be reminded of this from time to time.
  foreach sym $::SYMBOLS {
    set dirname "test_[string range $sym 7 end]"
    run_quick_test $dirname $sym
  }
}

main $argv

|







 







|
>
>
>
>
>









>
>













>
>
>
>
|
|







 







>
>
>
|
>







 







>
>


>

>

>
>
>




>
>

>


>
>


>
>
>

>

>


>



>


>
>





>







 







|










1
2
3
4
5
6
7
8
9
..
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
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
...
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
...
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
183
184
185
186
187
188
189
190
191
192
193
...
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213

set rcsid {$Id: omittest.tcl,v 1.5 2008/07/31 02:43:35 shane Exp $}

# Documentation for this script. This may be output to stderr
# if the script is invoked incorrectly.
set ::USAGE_MESSAGE {
This Tcl script is used to test the various compile time options 
available for omitting code (the SQLITE_OMIT_xxx options). It
should be invoked as follows:
................................................................................
# when doing so. For example:
#
#     run_quick_test /tmp/testdir {SQLITE_OMIT_TRIGGER SQLITE_OMIT_VIEW}
#
#
proc run_quick_test {dir omit_symbol_list} {
  # Compile the value of the OPTS Makefile variable.
  set opts "-DSQLITE_MEMDEBUG -DSQLITE_DEBUG" 
  if {$::tcl_platform(platform)=="windows"} {
    append opts " -DSQLITE_OS_WIN=1"
  } else {
    append opts " -DSQLITE_OS_UNIX=1"
  }
  foreach sym $omit_symbol_list {
    append opts " -D${sym}=1"
  }

  # Create the directory and do the build. If an error occurs return
  # early without attempting to run the test suite.
  file mkdir $dir
  puts -nonewline "Building $dir..."
  flush stdout
  file copy -force ./config.h $dir
  file copy -force ./libtool $dir
  set rc [catch {
    exec make -C $dir -f $::MAKEFILE testfixture OPTS=$opts >& $dir/build.log
  }]
  if {$rc} {
    puts "No good. See $dir/build.log."
    return
  } else {
    puts "Ok"
  }
  
  # Create an empty file "$dir/sqlite3". This is to trick the makefile out 
  # of trying to build the sqlite shell. The sqlite shell won't build 
  # with some of the OMIT options (i.e OMIT_COMPLETE).
  set sqlite3_dummy $dir/sqlite3
  if {$::tcl_platform(platform)=="windows"} {
    append sqlite3_dummy ".exe"
  }
  if {![file exists $sqlite3_dummy]} {
    set wr [open $sqlite3_dummy w]
    puts $wr "dummy"
    close $wr
  }

  # Run the test suite.
  puts -nonewline "Testing $dir..."
  flush stdout
................................................................................

# This proc processes the command line options passed to this script.
# Currently the only option supported is "-makefile", default
# "../Makefile.linux-gcc". Set the ::MAKEFILE variable to the value of this
# option.
#
proc process_options {argv} {
  if {$::tcl_platform(platform)=="windows"} {
      set ::MAKEFILE ../Makefile                        ;# Default value
  } else {
      set ::MAKEFILE ../Makefile.linux-gcc              ;# Default value
  }
  for {set i 0} {$i < [llength $argv]} {incr i} {
    switch -- [lindex $argv $i] {
      -makefile {
        incr i
        set ::MAKEFILE [lindex $argv $i]
      }
  
................................................................................
# Main routine.
#

proc main {argv} {
  # List of SQLITE_OMIT_XXX symbols supported by SQLite.
  set ::SYMBOLS [list                  \
    SQLITE_OMIT_ALTERTABLE             \
    SQLITE_OMIT_ANALYZE                \
    SQLITE_OMIT_ATTACH                 \
    SQLITE_OMIT_AUTHORIZATION          \
    SQLITE_OMIT_AUTOINCREMENT          \
    SQLITE_OMIT_AUTOINIT               \
    SQLITE_OMIT_AUTOVACUUM             \
    SQLITE_OMIT_BETWEEN_OPTIMIZATION   \
    SQLITE_OMIT_BLOB_LITERAL           \
    SQLITE_OMIT_BUILTIN_TEST           \
    SQLITE_OMIT_CAST                   \
    SQLITE_OMIT_CHECK                  \
    SQLITE_OMIT_COMPLETE               \
    SQLITE_OMIT_COMPOUND_SELECT        \
    SQLITE_OMIT_CONFLICT_CLAUSE        \
    SQLITE_OMIT_DATETIME_FUNCS         \
    SQLITE_OMIT_DECLTYPE               \
    SQLITE_OMIT_DISKIO                 \
    SQLITE_OMIT_EXPLAIN                \
    SQLITE_OMIT_FLAG_PRAGMAS           \
    SQLITE_OMIT_FLOATING_POINT         \
    SQLITE_OMIT_FOREIGN_KEY            \
    SQLITE_OMIT_GET_TABLE              \
    SQLITE_OMIT_GLOBALRECOVER          \
    SQLITE_OMIT_INCRBLOB               \
    SQLITE_OMIT_INTEGRITY_CHECK        \
    SQLITE_OMIT_LIKE_OPTIMIZATION      \
    SQLITE_OMIT_LOAD_EXTENSION         \
    SQLITE_OMIT_LOCALTIME              \
    SQLITE_OMIT_MEMORYDB               \
    SQLITE_OMIT_OR_OPTIMIZATION        \
    SQLITE_OMIT_PAGER_PRAGMAS          \
    SQLITE_OMIT_PARSER                 \
    SQLITE_OMIT_PRAGMA                 \
    SQLITE_OMIT_PROGRESS_CALLBACK      \
    SQLITE_OMIT_QUICKBALANCE           \
    SQLITE_OMIT_REINDEX                \
    SQLITE_OMIT_SCHEMA_PRAGMAS         \
    SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS \
    SQLITE_OMIT_SHARED_CACHE           \
    SQLITE_OMIT_SUBQUERY               \
    SQLITE_OMIT_TCL_VARIABLE           \
    SQLITE_OMIT_TEMPDB                 \
    SQLITE_OMIT_TRACE                  \
    SQLITE_OMIT_TRIGGER                \
    SQLITE_OMIT_UTF16                  \
    SQLITE_OMIT_VACUUM                 \
    SQLITE_OMIT_VIEW                   \
    SQLITE_OMIT_VIRTUALTABLE           \
    SQLITE_OMIT_XFER_OPT               \
  ]

  # Process any command line options.
  process_options $argv
  
  # First try a test with all OMIT symbols except SQLITE_OMIT_FLOATING_POINT 
  # and SQLITE_OMIT_PRAGMA defined. The former doesn't work (causes segfaults)
................................................................................
  set allsyms [list]
  foreach s $::SYMBOLS {
    if {$s!="SQLITE_OMIT_FLOATING_POINT" && $s!="SQLITE_OMIT_PRAGMA"} {
      lappend allsyms $s
    }
  }
  run_quick_test test_OMIT_EVERYTHING $allsyms

  # Now try one quick.test with each of the OMIT symbols defined. Included
  # are the OMIT_FLOATING_POINT and OMIT_PRAGMA symbols, even though we
  # know they will fail. It's good to be reminded of this from time to time.
  foreach sym $::SYMBOLS {
    set dirname "test_[string range $sym 7 end]"
    run_quick_test $dirname $sym
  }
}

main $argv