fts2.test 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. # 2008 July 22
  2. #
  3. # May you do good and not evil.
  4. # May you find forgiveness for yourself and forgive others.
  5. # May you share freely, never taking more than you give.
  6. #
  7. #***********************************************************************
  8. # This file runs all tests.
  9. #
  10. # $Id: fts2.test,v 1.2 2008/07/23 18:17:32 drh Exp $
  11. proc lshift {lvar} {
  12. upvar $lvar l
  13. set ret [lindex $l 0]
  14. set l [lrange $l 1 end]
  15. return $ret
  16. }
  17. while {[set arg [lshift argv]] != ""} {
  18. switch -- $arg {
  19. -sharedpagercache {
  20. sqlite3_enable_shared_cache 1
  21. }
  22. -soak {
  23. set G(issoak) 1
  24. }
  25. default {
  26. set argv [linsert $argv 0 $arg]
  27. break
  28. }
  29. }
  30. }
  31. set testdir [file dirname $argv0]
  32. source $testdir/tester.tcl
  33. # If SQLITE_ENABLE_FTS2 is defined, omit this file.
  34. ifcapable !fts2 {
  35. return
  36. }
  37. rename finish_test really_finish_test
  38. proc finish_test {} {}
  39. set G(isquick) 1
  40. set EXCLUDE {
  41. fts2.test
  42. }
  43. # Files to include in the test. If this list is empty then everything
  44. # that is not in the EXCLUDE list is run.
  45. #
  46. set INCLUDE {
  47. }
  48. foreach testfile [lsort -dictionary [glob $testdir/fts2*.test]] {
  49. set tail [file tail $testfile]
  50. if {[lsearch -exact $EXCLUDE $tail]>=0} continue
  51. if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tail]<0} continue
  52. source $testfile
  53. catch {db close}
  54. if {$sqlite_open_file_count>0} {
  55. puts "$tail did not close all files: $sqlite_open_file_count"
  56. fail_test $tail
  57. set sqlite_open_file_count 0
  58. }
  59. }
  60. set sqlite_open_file_count 0
  61. really_finish_test