/ Check-in [514adbbd]
Login

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

Overview
Comment:Add the "warning" command to the TCL test infrastructure. Fix problems with the loadext.test module.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:514adbbd8cf3e296f55e8f803bddaac8ad8b2c96
User & Date: drh 2013-04-19 12:32:52
Context
2013-04-22
02:39
Use transitivity to move constraints into the outer loops of a join whenever possible, thereby reducing the amount of work that needs to occur in inner loops. check-in: 5f4907e1 user: drh tags: trunk
2013-04-19
12:32
Add the "warning" command to the TCL test infrastructure. Fix problems with the loadext.test module. check-in: 514adbbd user: drh tags: trunk
02:47
Enhance the extension loading mechanism so that the same source code can be used for run-time loadable extensions and statically linked extensions, and to mask architectural differences in shared libraries. check-in: a85b6ece user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/loadext.test.

   135    135   #
   136    136   do_test loadext-2.1 {
   137    137     forcedelete ${testextension}xx
   138    138     set rc [catch {
   139    139       sqlite3_load_extension db "${testextension}xx"
   140    140     } msg]
   141    141     list $rc $msg
   142         -} [list 1 [format $dlerror_nosuchfile ${testextension}xx]]
          142  +} /[list 1 [format $dlerror_nosuchfile ${testextension}xx.*]]/
   143    143   
   144    144   # Try to load an extension for which the file is not a shared object
   145    145   #
   146    146   do_test loadext-2.2 {
   147         -  set fd [open "${testextension}xx" w]
          147  +  set fd [open "./notasharedlib.so" w]
          148  +  puts $fd blah
          149  +  close $fd
          150  +  set fd [open "./notasharedlib.dll" w]
   148    151     puts $fd blah
   149    152     close $fd
   150    153     set rc [catch {
   151         -    sqlite3_load_extension db "${testextension}xx"
          154  +    sqlite3_load_extension db "./notasharedlib"
   152    155     } msg]
   153         -  set expected_error_pattern [format $dlerror_notadll ${testextension}xx]
   154         -  list $rc [string match $expected_error_pattern $msg]
   155         -} [list 1 1]
          156  +  list $rc $msg
          157  +} /[list 1 [format $dlerror_notadll ./notasharedlib.*]]/
   156    158   
   157    159   # Try to load an extension for which the file is present but the
   158    160   # entry point is not.
   159    161   #
   160    162   do_test loadext-2.3 {
   161    163     set rc [catch {
   162    164       sqlite3_load_extension db $testextension icecream
................................................................................
   192    194     set res [catchsql {
   193    195       SELECT load_extension($::testextension)
   194    196     }]
   195    197     if {$::tcl_platform(os) eq "Darwin"} {
   196    198       regsub {0x[1234567890abcdefABCDEF]*} $res XXX res
   197    199     }
   198    200     set res
   199         -} [list 1 [format $dlerror_nosymbol $testextension sqlite3_extension_init]]
          201  +} /[list 1 [format $dlerror_nosymbol $testextension sqlite3_.*_init]]/
   200    202   do_test loadext-3.3 {
   201    203     catchsql {
   202    204       SELECT load_extension($::testextension,'testloadext_init')
   203    205     }
   204    206   } {0 {{}}}
   205    207   do_test loadext-3.4 {
   206    208     catchsql {

Changes to test/tester.tcl.

   458    458   # counters in the parent interpreter.
   459    459   #
   460    460   if {0==[info exists ::SLAVE]} {
   461    461     set TC(errors)    0
   462    462     set TC(count)     0
   463    463     set TC(fail_list) [list]
   464    464     set TC(omit_list) [list]
          465  +  set TC(warn_list) [list]
   465    466   
   466    467     proc set_test_counter {counter args} {
   467    468       if {[llength $args]} {
   468    469         set ::TC($counter) [lindex $args 0]
   469    470       }
   470    471       set ::TC($counter)
   471    472     }
................................................................................
   491    492   
   492    493     set nFail [set_test_counter errors]
   493    494     if {$nFail>=$::cmdlinearg(maxerror)} {
   494    495       puts "*** Giving up..."
   495    496       finalize_testing
   496    497     }
   497    498   }
          499  +
          500  +# Remember a warning message to be displayed at the conclusion of all testing
          501  +#
          502  +proc warning {msg {append 1}} {
          503  +  puts "Warning: $msg"
          504  +  set warnList [set_test_counter warn_list]
          505  +  if {$append} {
          506  +    lappend warnList $msg
          507  +  }
          508  +  set_test_counter warn_list $warnList
          509  +}
          510  +
   498    511   
   499    512   # Increment the number of tests run
   500    513   #
   501    514   proc incr_ntest {} {
   502    515     set_test_counter count [expr [set_test_counter count] + 1]
   503    516   }
   504    517   
................................................................................
   779    792     sqlite3_soft_heap_limit 0
   780    793     set nTest [incr_ntest]
   781    794     set nErr [set_test_counter errors]
   782    795   
   783    796     puts "$nErr errors out of $nTest tests"
   784    797     if {$nErr>0} {
   785    798       puts "Failures on these tests: [set_test_counter fail_list]"
          799  +  }
          800  +  foreach warning [set_test_counter warn_list] {
          801  +    puts "Warning: $warning"
   786    802     }
   787    803     run_thread_tests 1
   788    804     if {[llength $omitList]>0} {
   789    805       puts "Omitted test cases:"
   790    806       set prec {}
   791    807       foreach {rec} [lsort $omitList] {
   792    808         if {$rec==$prec} continue