mallocAll.test 1.5 KB

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