os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/all.test
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/persistentdata/persistentstorage/sqlite3api/TEST/TclScript/all.test	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,174 @@
     1.4 +# 2001 September 15
     1.5 +#
     1.6 +# Portions Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiaries. All rights reserved.
     1.7 +#
     1.8 +# The author disclaims copyright to this source code.  In place of
     1.9 +# a legal notice, here is a blessing:
    1.10 +#
    1.11 +#    May you do good and not evil.
    1.12 +#    May you find forgiveness for yourself and forgive others.
    1.13 +#    May you share freely, never taking more than you give.
    1.14 +#
    1.15 +#***********************************************************************
    1.16 +# This file runs all tests.
    1.17 +#
    1.18 +# $Id: all.test,v 1.58 2008/09/09 18:28:07 danielk1977 Exp $
    1.19 +
    1.20 +set testdir [file dirname $argv0]
    1.21 +source $testdir/tester.tcl
    1.22 +rename finish_test really_finish_test
    1.23 +proc finish_test {} {
    1.24 +  # no-op
    1.25 +}
    1.26 +
    1.27 +# Symbian: the ISQUICK value is set to 1. The number of the running tests is reduced.
    1.28 +set ISQUICK 1
    1.29 +
    1.30 +# Symbian: the COUNT value (the number of test runs) changed from 3 to 1. 
    1.31 +if {[file exists ./sqlite_test_count]} {
    1.32 +  set COUNT [exec cat ./sqlite_test_count]
    1.33 +} else {
    1.34 +  set COUNT 1
    1.35 +}
    1.36 +
    1.37 +if {[llength $argv]>0} {
    1.38 +  foreach {name value} $argv {
    1.39 +    switch -- $name {
    1.40 +      -count {
    1.41 +         set COUNT $value
    1.42 +      }
    1.43 +      -quick {
    1.44 +         set ISQUICK $value
    1.45 +      }
    1.46 +      -soak {
    1.47 +         set SOAKTEST $value
    1.48 +      }
    1.49 +      default {
    1.50 +         puts stderr "Unknown option: $name"
    1.51 +         exit
    1.52 +      }
    1.53 +    }
    1.54 +  }
    1.55 +}
    1.56 +set argv {}
    1.57 +
    1.58 +# LeakList will hold a list of the number of unfreed mallocs after
    1.59 +# each round of the test.  This number should be constant.  If it
    1.60 +# grows, it may mean there is a memory leak in the library.
    1.61 +#
    1.62 +set LeakList {}
    1.63 +
    1.64 +set EXCLUDE {}
    1.65 +lappend EXCLUDE all.test               ;# This file
    1.66 +lappend EXCLUDE async.test
    1.67 +lappend EXCLUDE crash.test             ;# Run seperately later.
    1.68 +lappend EXCLUDE crash2.test            ;# Run seperately later.
    1.69 +lappend EXCLUDE fuzz_malloc.test       ;# Symbian: the test crashes the test executable.
    1.70 +lappend EXCLUDE quick.test             ;# Alternate test driver script
    1.71 +lappend EXCLUDE veryquick.test         ;# Alternate test driver script
    1.72 +lappend EXCLUDE malloc.test            ;# Run seperately later.
    1.73 +lappend EXCLUDE misuse.test            ;# Run seperately later.
    1.74 +lappend EXCLUDE memleak.test           ;# Alternate test driver script
    1.75 +lappend EXCLUDE permutations.test      ;# Run seperately later.
    1.76 +lappend EXCLUDE rtree.test             ;# Excluded, because the Symbian SQLite port does not use the R-Tree module.
    1.77 +lappend EXCLUDE fuzz.test
    1.78 +lappend EXCLUDE fuzz3.test
    1.79 +lappend EXCLUDE soak.test              ;# Takes a very long time (default 1 hr)
    1.80 +lappend EXCLUDE fts3.test              ;# Wrapper for muliple fts3*.tests
    1.81 +lappend EXCLUDE mallocall.test         ;# Wrapper for running all malloc tests
    1.82 +lappend EXCLUDE speed1.test			   ;# Symbian OS: Excluding all "speed" tests, the first one is crashing all.test.
    1.83 +lappend EXCLUDE speed1p.test		   ;# Also, these "speed" tests are not that useful for Symbian OS.
    1.84 +lappend EXCLUDE speed2.test
    1.85 +lappend EXCLUDE speed3.test
    1.86 +lappend EXCLUDE speed4.test
    1.87 +lappend EXCLUDE speed4p.test
    1.88 +
    1.89 +# Files to include in the test.  If this list is empty then everything
    1.90 +# that is not in the EXCLUDE list is run.
    1.91 +#
    1.92 +set INCLUDE {
    1.93 +}
    1.94 +
    1.95 +for {set Counter 0} {$Counter<$COUNT && $nErr==0} {incr Counter} {
    1.96 +  if {$Counter%2} {
    1.97 +    set ::SETUP_SQL {PRAGMA default_synchronous=off;}
    1.98 +  } else {
    1.99 +    catch {unset ::SETUP_SQL}
   1.100 +  }
   1.101 +  foreach testfile [lsort -dictionary [glob $testdir/*.test]] {
   1.102 +    #Symbian OS: tail is overwritten in misc5.test, so use a new var tname for it here.
   1.103 +    set tname [file tail $testfile]
   1.104 +    if {[lsearch -exact $EXCLUDE $tname]>=0} continue
   1.105 +    if {[llength $INCLUDE]>0 && [lsearch -exact $INCLUDE $tname]<0} continue
   1.106 +    print_text "" $tname
   1.107 +    start_case $tname
   1.108 +    reset_prng_state
   1.109 +    source $testfile
   1.110 +    catch {db close}
   1.111 +    if {$sqlite_open_file_count>0} {
   1.112 +      puts "$tname did not close all files: $sqlite_open_file_count"
   1.113 +      # Symbian OS: Set and increase error count with do_fail procedure (definition in Tester.tcl)
   1.114 +      do_fail $tname 
   1.115 +      set sqlite_open_file_count 0
   1.116 +    }
   1.117 +    end_case $tname
   1.118 +  }
   1.119 +  if {[info exists Leak]} {
   1.120 +    lappend LeakList $Leak
   1.121 +  }
   1.122 +}
   1.123 +
   1.124 +# Symbian OS: permutation tests disabled. The permutation tests are not that important, because the SQLite port is offered with hard-coded config settings.
   1.125 +if {$::tcl_platform(platform)!="symbian"} {
   1.126 +  set argv all
   1.127 +  source $testdir/permutations.test
   1.128 +  set argv ""
   1.129 +}
   1.130 +
   1.131 +# Do one last test to look for a memory leak in the library.  This will
   1.132 +# only work if SQLite is compiled with the -DSQLITE_DEBUG=1 flag.
   1.133 +#
   1.134 +if {$LeakList!=""} {
   1.135 +  puts -nonewline memory-leak-test...
   1.136 +  incr ::nTest
   1.137 +  foreach x $LeakList {
   1.138 +    if {$x!=[lindex $LeakList 0]} {
   1.139 +       puts " failed!"
   1.140 +       puts "Expected: all values to be the same"
   1.141 +       puts "     Got: $LeakList"
   1.142 +       # Symbian OS: Set and increase error count with do_fail procedure (definition in Tester.tcl)
   1.143 +       do_fail memory-leak-test 
   1.144 +       break
   1.145 +    }
   1.146 +  }
   1.147 +  puts " Ok"
   1.148 +}
   1.149 +
   1.150 +# Run the crashtest only on unix and only once. If the library does not
   1.151 +# always create auto-vacuum databases, also run autovacuum_crash.test.
   1.152 +#
   1.153 +if {$::tcl_platform(platform)=="unix"} {
   1.154 +  source $testdir/crash.test
   1.155 +  source $testdir/crash2.test
   1.156 +  ifcapable !default_autovacuum {
   1.157 +    set argv autovacuum_crash
   1.158 +    source $testdir/permutations.test
   1.159 +    set argv ""
   1.160 +  }
   1.161 +}
   1.162 +
   1.163 +# Run the malloc tests and the misuse test after memory leak detection.
   1.164 +# Both tests leak memory. Currently, misuse.test also leaks a handful of
   1.165 +# file descriptors. This is not considered a problem, but can cause tests
   1.166 +# in malloc.test to fail. So set the open-file count to zero before running
   1.167 +# malloc.test to get around this.
   1.168 +#
   1.169 +# Symbian OS: misuse/malloc tests disabled
   1.170 +if {$::tcl_platform(platform)!="symbian"} {
   1.171 +  catch {source $testdir/misuse.test}
   1.172 +  set sqlite_open_file_count 0
   1.173 +  catch {source $testdir/malloc.test}
   1.174 +}
   1.175 +catch {db close}
   1.176 +set sqlite_open_file_count 0
   1.177 +really_finish_test