os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/quick.test
author sl@SLION-WIN7.fritz.box
Fri, 15 Jun 2012 03:10:57 +0200 (2012-06-15)
changeset 0 bde4ae8d615e
permissions -rw-r--r--
First public contribution.
sl@0
     1
#
sl@0
     2
# Portions Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiaries. All rights reserved.
sl@0
     3
#
sl@0
     4
#    May you do good and not evil.
sl@0
     5
#    May you find forgiveness for yourself and forgive others.
sl@0
     6
#    May you share freely, never taking more than you give.
sl@0
     7
#
sl@0
     8
#***********************************************************************
sl@0
     9
# This file runs all tests.
sl@0
    10
#
sl@0
    11
# $Id: quick.test,v 1.87 2008/09/09 18:28:07 danielk1977 Exp $
sl@0
    12
sl@0
    13
proc lshift {lvar} {
sl@0
    14
  upvar $lvar l
sl@0
    15
  set ret [lindex $l 0]
sl@0
    16
  set l [lrange $l 1 end]
sl@0
    17
  return $ret
sl@0
    18
}
sl@0
    19
while {[set arg [lshift argv]] != ""} {
sl@0
    20
  switch -- $arg {
sl@0
    21
    -sharedpagercache {
sl@0
    22
      sqlite3_enable_shared_cache 1
sl@0
    23
    }
sl@0
    24
    -soak {
sl@0
    25
       set SOAKTEST 1
sl@0
    26
    }
sl@0
    27
    -start {
sl@0
    28
       set STARTAT "[lshift argv]*"
sl@0
    29
    }
sl@0
    30
    default {
sl@0
    31
      set argv [linsert $argv 0 $arg]
sl@0
    32
      break
sl@0
    33
    }
sl@0
    34
  }
sl@0
    35
}
sl@0
    36
sl@0
    37
set testdir [file dirname $argv0]
sl@0
    38
source $testdir/tester.tcl
sl@0
    39
rename finish_test really_finish_test
sl@0
    40
proc finish_test {} {}
sl@0
    41
set ISQUICK 1
sl@0
    42
sl@0
    43
set EXCLUDE {
sl@0
    44
  all.test
sl@0
    45
  async.test
sl@0
    46
  async2.test
sl@0
    47
  async3.test
sl@0
    48
  corrupt.test
sl@0
    49
  crash.test
sl@0
    50
  crash2.test
sl@0
    51
  crash3.test
sl@0
    52
  crash4.test
sl@0
    53
  crash5.test
sl@0
    54
  crash6.test
sl@0
    55
  crash7.test
sl@0
    56
  delete3.test
sl@0
    57
  fts3.test
sl@0
    58
  fuzz.test
sl@0
    59
  fuzz3.test
sl@0
    60
  fuzz_malloc.test
sl@0
    61
  in2.test
sl@0
    62
  loadext.test
sl@0
    63
  memleak.test
sl@0
    64
  misc7.test
sl@0
    65
  misuse.test
sl@0
    66
  mutex2.test
sl@0
    67
  onefile.test
sl@0
    68
  permutations.test
sl@0
    69
  quick.test
sl@0
    70
  rtree.test
sl@0
    71
  select9.test
sl@0
    72
  soak.test
sl@0
    73
  speed1.test
sl@0
    74
  speed1p.test
sl@0
    75
  speed2.test
sl@0
    76
  speed3.test
sl@0
    77
  speed4.test
sl@0
    78
  speed4p.test
sl@0
    79
  sqllimits1.test
sl@0
    80
  tkt2686.test
sl@0
    81
  thread001.test
sl@0
    82
  thread002.test
sl@0
    83
  thread003.test
sl@0
    84
  trans2.test
sl@0
    85
  vacuum3.test
sl@0
    86
sl@0
    87
  incrvacuum_ioerr.test
sl@0
    88
  autovacuum_crash.test
sl@0
    89
  btree8.test
sl@0
    90
  shared_err.test
sl@0
    91
  vtab_err.test
sl@0
    92
  veryquick.test
sl@0
    93
  mallocAll.test
sl@0
    94
}
sl@0
    95
sl@0
    96
if {[sqlite3 -has-codec]} {
sl@0
    97
  # lappend EXCLUDE \
sl@0
    98
  #  conflict.test
sl@0
    99
}
sl@0
   100
sl@0
   101
sl@0
   102
# Files to include in the test.  If this list is empty then everything
sl@0
   103
# that is not in the EXCLUDE list is run.
sl@0
   104
#
sl@0
   105
set INCLUDE {
sl@0
   106
}
sl@0
   107
sl@0
   108
foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
sl@0
   109
  # If this is "veryquick.test", do not run any of the malloc or 
sl@0
   110
  # IO error simulations.
sl@0
   111
  if {[info exists ISVERYQUICK] && (
sl@0
   112
    [string match *malloc* $testfile] || [string match *ioerr* $testfile]
sl@0
   113
  ) } {
sl@0
   114
    continue
sl@0
   115
  }
sl@0
   116
sl@0
   117
  #Symbian OS: tail is overwritten in misc5.test, so use a new var tname for it here.
sl@0
   118
  set tname [file tail $testfile]
sl@0
   119
  if {[lsearch -exact $EXCLUDE $tname]>=0} continue
sl@0
   120
  if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tname]<0} continue
sl@0
   121
  if {[info exists STARTAT] && [string match $STARTAT $tname]} {unset STARTAT}
sl@0
   122
  if {[info exists STARTAT]} continue
sl@0
   123
  print_text "" $tname
sl@0
   124
  start_case $tname
sl@0
   125
  source $testfile
sl@0
   126
  catch {db close}
sl@0
   127
  if {$sqlite_open_file_count>0} {
sl@0
   128
    puts "$tname did not close all files: $sqlite_open_file_count"
sl@0
   129
    # Symbian OS: Set and increase error count with do_fail procedure (definition in Tester.tcl)
sl@0
   130
    do_fail $tname 
sl@0
   131
    set sqlite_open_file_count 0
sl@0
   132
  }
sl@0
   133
sl@0
   134
  foreach var [info vars] {
sl@0
   135
    catch { if {[string length [set $var]] > 25000} { unset $var } }
sl@0
   136
  }
sl@0
   137
  
sl@0
   138
  end_case $tname
sl@0
   139
}
sl@0
   140
#set argv quick
sl@0
   141
#source $testdir/permutations.test
sl@0
   142
#set argv ""
sl@0
   143
source $testdir/misuse.test
sl@0
   144
sl@0
   145
set sqlite_open_file_count 0
sl@0
   146
really_finish_test