/ Check-in [1ffe3cde]
Login

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

Overview
Comment:Fix test scripts sqldiff.test and rbudiff.test so that they work with the --testdir option.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1ffe3cde03f924bb8405a8729c8e1bc01f5b6d3b
User & Date: dan 2016-03-19 14:53:36
Context
2016-03-19
15:13
Fix another problem in test script rbudiff.test. check-in: 41c29c12 user: dan tags: trunk
14:53
Fix test scripts sqldiff.test and rbudiff.test so that they work with the --testdir option. check-in: 1ffe3cde user: dan tags: trunk
00:35
Fix a register allocation bug in the VDBE code generator for PRAGMA integrity_check; check-in: 88439a86 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to ext/rbu/rbudiff.test.

    14     14   #
    15     15   if {![info exists testdir]} {
    16     16     set testdir [file join [file dirname [info script]] .. .. test]
    17     17   }
    18     18   source $testdir/tester.tcl
    19     19   set testprefix rbudiff
    20     20   
    21         -if {$tcl_platform(platform)=="windows"} {
    22         -  set PROG "sqldiff.exe"
    23         -} else {
    24         -  set PROG "./sqldiff"
    25         -}
    26         -if {![file exe $PROG]} {
    27         -  puts "rbudiff.test cannot run because $PROG is not available"
    28         -  finish_test
    29         -  return
    30         -}
           21  +set PROG [test_find_sqldiff]
    31     22   db close
    32     23   
    33     24   proc get_rbudiff_sql {db1 db2} {
    34     25     exec $::PROG --rbu $db1 $db2
    35     26   }
    36     27   
    37     28   proc step_rbu {target rbu} {

Changes to test/sqldiff1.test.

    10     10   #***********************************************************************
    11     11   #
    12     12   # Quick tests for the sqldiff tool
    13     13   #
    14     14   set testdir [file dirname $argv0]
    15     15   source $testdir/tester.tcl
    16     16   
    17         -if {$tcl_platform(platform)=="windows"} {
    18         -  set PROG "sqldiff.exe"
    19         -} else {
    20         -  set PROG "./sqldiff"
    21         -}
    22         -if {![file exe $PROG]} {
    23         -  puts "sqldiff cannot run because $PROG is not available"
    24         -  finish_test
    25         -  return
    26         -}
           17  +set PROG [test_find_sqldiff]
           18  +
    27     19   db close
    28     20   forcedelete test.db test2.db
    29     21   sqlite3 db test.db
    30     22   
    31     23   do_test sqldiff-1.0 {
    32     24     db eval {
    33     25       CREATE TABLE t1(a INTEGER PRIMARY KEY, b);

Changes to test/tester.tcl.

  2132   2132     eval sqlite3_config_pagecache $::old_pagecache_config
  2133   2133     unset ::old_pagecache_config 
  2134   2134     sqlite3_initialize
  2135   2135     autoinstall_test_functions
  2136   2136     sqlite3 db test.db
  2137   2137   }
  2138   2138   
  2139         -# Find the name of the 'shell' executable (e.g. "sqlite3.exe") to use for
  2140         -# the tests in shell[1-5].test. If no such executable can be found, invoke
  2141         -# [finish_test ; return] in the callers context.
  2142         -#
  2143         -proc test_find_cli {} {
         2139  +proc test_find_binary {nm} {
  2144   2140     if {$::tcl_platform(platform)=="windows"} {
  2145         -    set ret "sqlite3.exe"
         2141  +    set ret "$nm.exe"
  2146   2142     } else {
  2147         -    set ret "sqlite3"
         2143  +    set ret $nm
  2148   2144     }
  2149   2145     set ret [file normalize [file join $::cmdlinearg(TESTFIXTURE_HOME) $ret]]
  2150   2146     if {![file executable $ret]} {
  2151   2147       finish_test
  2152   2148       return -code return
  2153   2149     }
  2154   2150     return $ret
  2155   2151   }
         2152  +
         2153  +# Find the name of the 'shell' executable (e.g. "sqlite3.exe") to use for
         2154  +# the tests in shell[1-5].test. If no such executable can be found, invoke
         2155  +# [finish_test ; return] in the callers context.
         2156  +#
         2157  +proc test_find_cli {} {
         2158  +  uplevel test_find_binary sqlite3
         2159  +}
         2160  +
         2161  +# Find the name of the 'sqldiff' executable (e.g. "sqlite3.exe") to use for
         2162  +# the tests in sqldiff tests. If no such executable can be found, invoke
         2163  +# [finish_test ; return] in the callers context.
         2164  +#
         2165  +proc test_find_sqldiff {} {
         2166  +  uplevel test_find_binary sqldiff
         2167  +}
         2168  +
  2156   2169   
  2157   2170   # If the library is compiled with the SQLITE_DEFAULT_AUTOVACUUM macro set
  2158   2171   # to non-zero, then set the global variable $AUTOVACUUM to 1.
  2159   2172   set AUTOVACUUM $sqlite_options(default_autovacuum)
  2160   2173   
  2161   2174   # Make sure the FTS enhanced query syntax is disabled.
  2162   2175   set sqlite_fts3_enable_parentheses 0