/ Check-in [90e0cc7b]
Login

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

Overview
Comment:Run TCL tests in the "testdir" subdirectory.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:90e0cc7b0be31ee2f155c2c053b0cbac584f6154
User & Date: drh 2016-03-14 15:03:54
Context
2016-03-14
16:16
Test script changes to support testing the SQLite Encryption Extension. check-in: 1c70aa5c user: drh tags: see-testing
15:43
Fix the backcompat.test script so that it works with the --testdir test option. check-in: f7480e33 user: dan tags: trunk
15:03
Run TCL tests in the "testdir" subdirectory. check-in: 90e0cc7b user: drh tags: trunk
14:59
More file pathname normalization. Closed-Leaf check-in: fa8c1292 user: drh tags: test-in-subdir
12:16
Fix a memory leak in fts5 that could occur following a syntax error in a query expression. check-in: 54b8968e user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to test/analyzer1.test.

    21     21   
    22     22   if {$tcl_platform(platform)=="windows"} {
    23     23     set PROG "sqlite3_analyzer.exe"
    24     24   } else {
    25     25     set PROG "./sqlite3_analyzer"
    26     26   }
    27     27   if {![file exe $PROG]} {
    28         -  puts "analyzer1 cannot run because $PROG is not available"
    29         -  finish_test
    30         -  return
           28  +  set PROG [file normalize [file join $::cmdlinearg(TESTFIXTURE_HOME) $PROG]]
           29  +  if {![file exe $PROG]} {
           30  +    puts "analyzer1 cannot run because $PROG is not available"
           31  +    finish_test
           32  +    return
           33  +  }
    31     34   }
    32     35   db close
    33     36   forcedelete test.db test.db-journal test.db-wal
    34     37   sqlite3 db test.db
    35     38   
    36     39   do_test analyzer1-1.0 {
    37     40     db eval {

Changes to test/tester.tcl.

   407    407     #   --soak=N
   408    408     #   --file-retries=N
   409    409     #   --file-retry-delay=N
   410    410     #   --start=[$permutation:]$testfile
   411    411     #   --match=$pattern
   412    412     #   --verbose=$val
   413    413     #   --output=$filename
          414  +  #   -q                                      Reduce output
          415  +  #   --testdir=$dir                          Run tests in subdirectory $dir
   414    416     #   --help
   415    417     #
   416    418     set cmdlinearg(soft-heap-limit)    0
   417    419     set cmdlinearg(maxerror)        1000
   418    420     set cmdlinearg(malloctrace)        0
   419    421     set cmdlinearg(backtrace)         10
   420    422     set cmdlinearg(binarylog)          0
................................................................................
   421    423     set cmdlinearg(soak)               0
   422    424     set cmdlinearg(file-retries)       0
   423    425     set cmdlinearg(file-retry-delay)   0
   424    426     set cmdlinearg(start)             ""
   425    427     set cmdlinearg(match)             ""
   426    428     set cmdlinearg(verbose)           ""
   427    429     set cmdlinearg(output)            ""
          430  +  set cmdlinearg(testdir)           "testdir"
   428    431   
   429    432     set leftover [list]
   430    433     foreach a $argv {
   431    434       switch -regexp -- $a {
   432    435         {^-+pause$} {
   433    436           # Wait for user input before continuing. This is to give the user an
   434    437           # opportunity to connect profiling tools to the process.
................................................................................
   450    453         }
   451    454         {^-+backtrace=.+$} {
   452    455           foreach {dummy cmdlinearg(backtrace)} [split $a =] break
   453    456           sqlite3_memdebug_backtrace $value
   454    457         }
   455    458         {^-+binarylog=.+$} {
   456    459           foreach {dummy cmdlinearg(binarylog)} [split $a =] break
          460  +        set cmdlinearg(binarylog) [file normalize $cmdlinearg(binarylog)]
   457    461         }
   458    462         {^-+soak=.+$} {
   459    463           foreach {dummy cmdlinearg(soak)} [split $a =] break
   460    464           set ::G(issoak) $cmdlinearg(soak)
   461    465         }
   462    466         {^-+file-retries=.+$} {
   463    467           foreach {dummy cmdlinearg(file-retries)} [split $a =] break
................................................................................
   482    486   
   483    487           set ::G(match) $cmdlinearg(match)
   484    488           if {$::G(match) == ""} {unset ::G(match)}
   485    489         }
   486    490   
   487    491         {^-+output=.+$} {
   488    492           foreach {dummy cmdlinearg(output)} [split $a =] break
          493  +        set cmdlinearg(output) [file normalize $cmdlinearg(output)]
   489    494           if {$cmdlinearg(verbose)==""} {
   490    495             set cmdlinearg(verbose) 2
   491    496           }
   492    497         }
   493    498         {^-+verbose=.+$} {
   494    499           foreach {dummy cmdlinearg(verbose)} [split $a =] break
   495    500           if {$cmdlinearg(verbose)=="file"} {
   496    501             set cmdlinearg(verbose) 2
   497    502           } elseif {[string is boolean -strict $cmdlinearg(verbose)]==0} {
   498    503             error "option --verbose= must be set to a boolean or to \"file\""
   499    504           }
   500    505         }
          506  +      {^-+testdir=.*$} {
          507  +        foreach {dummy cmdlinearg(testdir)} [split $a =] break
          508  +      }
   501    509         {.*help.*} {
   502    510            print_help_and_quit
   503    511         }
   504    512         {^-q$} {
   505    513           set cmdlinearg(output) test-out.txt
   506    514           set cmdlinearg(verbose) 2
   507    515         }
   508    516   
   509    517         default {
   510         -        lappend leftover $a
          518  +        lappend leftover [file normalize $a]
   511    519         }
   512    520       }
          521  +  }
          522  +  set testdir [file normalize $testdir]
          523  +  set cmdlinearg(TESTFIXTURE_HOME) [pwd]
          524  +  set argv0 [file normalize $argv0]
          525  +  if {$cmdlinearg(testdir)!=""} {
          526  +    file mkdir $cmdlinearg(testdir)
          527  +    cd $cmdlinearg(testdir)
   513    528     }
   514    529     set argv $leftover
   515    530   
   516    531     # Install the malloc layer used to inject OOM errors. And the 'automatic'
   517    532     # extensions. This only needs to be done once for the process.
   518    533     #
   519    534     sqlite3_shutdown