System.Data.SQLite
Check-in [b35fffe201]
Not logged in

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

Overview
Comment:Allow the directory used for test databases to be easily overridden for the vast majority of tests.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: b35fffe201c1eac26e3bbc71525c07b9091c11ff
User & Date: mistachkin 2011-12-16 08:33:16
Context
2011-12-16
08:45
Revise the CLR method used to force a full garbage collection in the unit test infrastructure. check-in: e1319dd971 user: mistachkin tags: trunk
08:33
Allow the directory used for test databases to be easily overridden for the vast majority of tests. check-in: b35fffe201 user: mistachkin tags: trunk
07:09
Report memory currently in use by the CLR before and after each test file. check-in: 3fae72f823 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/basic.eagle.

    49     49     checkForFile $test_channel $testLinqOutFile
    50     50   }
    51     51   
    52     52   ###############################################################################
    53     53   
    54     54   runTest {test data-1.1 {unit tests from the 'test' project} -setup {
    55     55     catch {file delete [file join [file dirname $testExeFile] Test.db3]}
           56  +  set fileName [file join [getDatabaseDirectory] data-1.1.db]
           57  +  catch {file delete $fileName}
    56     58   } -body {
    57     59     set output ""
    58     60   
    59     61     set code [catch {
           62  +    #
           63  +    # NOTE: For the sake of backward compatibility, the "-autoRun" argument
           64  +    #       must be first.
           65  +    #
    60     66       testClrExec $testExeFile [list -eventflags Wait -directory \
    61         -    [file dirname $testExeFile] -stdout output -success 0] -autoRun
           67  +    [file dirname $testExeFile] -stdout output -success 0] -autoRun \
           68  +    -fileName [appendArgs \" [file nativename $fileName] \"]
    62     69     } error]
    63     70   
    64     71     tlog "---- BEGIN STDOUT OUTPUT\n"
    65     72     tlog $output
    66     73     tlog "\n---- END STDOUT OUTPUT\n"
    67     74   
    68     75     list $code [expr {$code == 0 ? "" : $error}]
    69     76   } -cleanup {
    70         -  unset -nocomplain code output error
           77  +  unset -nocomplain code output error fileName
    71     78   } -constraints {eagle file_test.exe} -result {0 {}}}
    72     79   
    73     80   ###############################################################################
    74     81   
    75     82   runTest {test data-1.2 {unit tests from the 'testlinq' project} -setup {
    76     83     #
    77     84     # NOTE: Re-copy the reference database file used for this unit test to the
................................................................................
   141    148   
   142    149   ###############################################################################
   143    150   
   144    151   runTest {test data-1.4 {GetSchema with ReservedWords} -setup {
   145    152     setupDb [set fileName data-1.4.db]
   146    153   } -body {
   147    154     set id [object invoke Interpreter.GetActive NextId]
   148         -  set dataSource [file join [getTemporaryPath] data-1.4.db]
          155  +  set dataSource [file join [getDatabaseDirectory] data-1.4.db]
   149    156   
   150    157     unset -nocomplain results errors
   151    158   
   152    159     set code [compileCSharpWith [subst {
   153    160       using System.Data;
   154    161       using System.Data.SQLite;
   155    162   
................................................................................
   201    208         DEFAULT 1
   202    209       );
   203    210     }
   204    211   
   205    212     sql execute $db "CREATE TABLE t2(x INTEGER REFERENCES t3);"
   206    213   
   207    214     set id [object invoke Interpreter.GetActive NextId]
   208         -  set dataSource [file join [getTemporaryPath] data-1.5.db]
          215  +  set dataSource [file join [getDatabaseDirectory] data-1.5.db]
   209    216   
   210    217     unset -nocomplain results errors
   211    218   
   212    219     set code [compileCSharpWith [subst {
   213    220       using System.Data;
   214    221       using System.Data.SQLite;
   215    222   
................................................................................
   277    284   
   278    285   ###############################################################################
   279    286   
   280    287   runTest {test data-1.6 {SQLITE_FCNTL_WIN32_AV_RETRY} -setup {
   281    288     setupDb [set fileName data-1.6.db]
   282    289   } -body {
   283    290     set id [object invoke Interpreter.GetActive NextId]
   284         -  set dataSource [file join [getTemporaryPath] data-1.6.db]
          291  +  set dataSource [file join [getDatabaseDirectory] data-1.6.db]
   285    292   
   286    293     unset -nocomplain results errors
   287    294   
   288    295     set code [compileCSharpWith [subst {
   289    296       using System.Data;
   290    297       using System.Data.SQLite;
   291    298   
................................................................................
   377    384   
   378    385   ###############################################################################
   379    386   
   380    387   runTest {test data-1.7 {properly closed database file (non-query)} -setup {
   381    388     set fileName data-1.7.db
   382    389   } -body {
   383    390     set id [object invoke Interpreter.GetActive NextId]
   384         -  set dataSource [file join [getTemporaryPath] $fileName]
          391  +  set dataSource [file join [getDatabaseDirectory] $fileName]
   385    392   
   386    393     set sql { \
   387    394       BEGIN EXCLUSIVE TRANSACTION; \
   388    395       CREATE TABLE t1(x INTEGER); \
   389    396       INSERT INTO t1 (x) VALUES(1); \
   390    397       SELECT * FROM t1; \
   391    398     }
................................................................................
   435    442   
   436    443   ###############################################################################
   437    444   
   438    445   runTest {test data-1.8 {properly closed database file (reader #1)} -setup {
   439    446     set fileName data-1.8.db
   440    447   } -body {
   441    448     set id [object invoke Interpreter.GetActive NextId]
   442         -  set dataSource [file join [getTemporaryPath] $fileName]
          449  +  set dataSource [file join [getDatabaseDirectory] $fileName]
   443    450   
   444    451     set sql { \
   445    452       BEGIN EXCLUSIVE TRANSACTION; \
   446    453       CREATE TABLE t1(x INTEGER); \
   447    454       INSERT INTO t1 (x) VALUES(1); \
   448    455       SELECT * FROM t1; \
   449    456     }
................................................................................
   496    503   
   497    504   ###############################################################################
   498    505   
   499    506   runTest {test data-1.9 {properly closed database file (reader #2)} -setup {
   500    507     set fileName data-1.9.db
   501    508   } -body {
   502    509     set id [object invoke Interpreter.GetActive NextId]
   503         -  set dataSource [file join [getTemporaryPath] $fileName]
          510  +  set dataSource [file join [getDatabaseDirectory] $fileName]
   504    511   
   505    512     set sql { \
   506    513       BEGIN EXCLUSIVE TRANSACTION; \
   507    514       CREATE TABLE t1(x INTEGER); \
   508    515       INSERT INTO t1 (x) VALUES(1); \
   509    516       SELECT * FROM t1; \
   510    517     }

Changes to Tests/common.eagle.

   180    180         }
   181    181       }
   182    182   
   183    183       proc getBinaryFileName { fileName } {
   184    184         return [file nativename \
   185    185             [file join [getBinaryDirectory] [file tail $fileName]]]
   186    186       }
          187  +
          188  +    proc getDatabaseDirectory {} {
          189  +      #
          190  +      # NOTE: This procedure returns the directory where the test databases
          191  +      #       should be located.  By default, this just uses the temporary
          192  +      #       directory configured for this system.
          193  +      #
          194  +      if {[info exists ::database_directory] && \
          195  +          [string length $::database_directory] > 0} then {
          196  +        #
          197  +        # NOTE: The location of the database directory has been overridden;
          198  +        #       therefore, use it.
          199  +        #
          200  +        return [file normalize $::database_directory]
          201  +      } else {
          202  +        return [getTemporaryPath]
          203  +      }
          204  +    }
   187    205   
   188    206       proc getAppDomainPreamble { {prefix ""} {suffix ""} } {
   189    207         #
   190    208         # NOTE: This procedure returns a test setup script suitable for evaluation
   191    209         #       by a test interpreter created in an isolated application domain.
   192    210         #       The script being returned will be surrounded by the prefix and
   193    211         #       suffix "script fragments" specified by the caller, if any.  The
................................................................................
   406    424               fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {extra ""}
   407    425               {delete true} {varName db}} {
   408    426         #
   409    427         # NOTE: For now, all test databases used by the test suite are placed into
   410    428         #       the temporary directory.  Each database used by a test should be
   411    429         #       cleaned up by that test using the "cleanupDb" procedure, below.
   412    430         #
   413         -      set fileName [file join [getTemporaryPath] [file tail $fileName]]
          431  +      set fileName [file join [getDatabaseDirectory] [file tail $fileName]]
   414    432   
   415    433         #
   416    434         # NOTE: By default, delete any pre-existing database with the same file
   417    435         #       name if it currently exists.
   418    436         #
   419    437         if {$delete && [file exists $fileName]} then {
   420    438           if {[catch {file delete $fileName} error]} then {
................................................................................
   498    516               \n\t $error \n]
   499    517         }
   500    518   
   501    519         #
   502    520         # NOTE: Build the full path to the database file name.  For now, all test
   503    521         #       database files are stored in the temporary directory.
   504    522         #
   505         -      set fileName [file join [getTemporaryPath] [file tail $fileName]]
          523  +      set fileName [file join [getDatabaseDirectory] [file tail $fileName]]
   506    524   
   507    525         if {[file exists $fileName]} then {
   508    526           #
   509    527           # NOTE: Attempt to delete the test database file now.
   510    528           #
   511    529           if {[set code [catch {file delete $fileName} error]]} then {
   512    530             #

Changes to Tests/tkt-343d392b51.eagle.

    87     87   ###############################################################################
    88     88   
    89     89   runTest {test tkt-343d392b51-2.1 {SQLiteDataAdapter update fail} -setup {
    90     90     setupDb [set fileName tkt-343d392b51-2.1.db]
    91     91     set otherFileName tkt-343d392b51-2.1-otherDb.db
    92     92   } -body {
    93     93     set id [object invoke Interpreter.GetActive NextId]
    94         -  set dataSource [file join [getTemporaryPath] $fileName]
    95         -  set otherDataSource [file join [getTemporaryPath] $otherFileName]
           94  +  set dataSource [file join [getDatabaseDirectory] $fileName]
           95  +  set otherDataSource [file join [getDatabaseDirectory] $otherFileName]
    96     96     set otherDbName otherDb
    97     97     set otherTable [appendArgs $otherDbName .t1]
    98     98   
    99     99     set sql(inserts) ""
   100    100     set sql(1) [subst { \
   101    101       ATTACH DATABASE '${otherDataSource}' AS ${otherDbName}; \
   102    102       CREATE TABLE ${otherTable}(x INTEGER PRIMARY KEY, y DATETIME); \
................................................................................
   193    193   ###############################################################################
   194    194   
   195    195   runTest {test tkt-343d392b51-2.2 {SQLiteDataAdapter update success} -setup {
   196    196     setupDb [set fileName tkt-343d392b51-2.2.db] "" JulianDay
   197    197     set otherFileName tkt-343d392b51-2.2-otherDb.db
   198    198   } -body {
   199    199     set id [object invoke Interpreter.GetActive NextId]
   200         -  set dataSource [file join [getTemporaryPath] $fileName]
   201         -  set otherDataSource [file join [getTemporaryPath] $otherFileName]
          200  +  set dataSource [file join [getDatabaseDirectory] $fileName]
          201  +  set otherDataSource [file join [getDatabaseDirectory] $otherFileName]
   202    202     set otherDbName otherDb
   203    203     set otherTable [appendArgs $otherDbName .t1]
   204    204   
   205    205     set sql(inserts) ""
   206    206     set sql(1) [subst { \
   207    207       ATTACH DATABASE '${otherDataSource}' AS ${otherDbName}; \
   208    208       CREATE TABLE ${otherTable}(x INTEGER PRIMARY KEY, y DATETIME); \
................................................................................
   298    298   
   299    299   ###############################################################################
   300    300   
   301    301   runTest {test tkt-343d392b51-3.1 {attached database, same table name} -setup {
   302    302     setupDb [set fileName tkt-343d392b51-3.1.db]
   303    303     set otherFileName tkt-343d392b51-3.1-otherDb.db
   304    304   } -body {
   305         -  set otherDataSource [file join [getTemporaryPath] $otherFileName]
          305  +  set otherDataSource [file join [getDatabaseDirectory] $otherFileName]
   306    306     set otherDbName otherDb
   307    307     set otherTable [appendArgs $otherDbName .t1]
   308    308   
   309    309     set sql(inserts) ""
   310    310     set sql(1) [subst { \
   311    311       CREATE TABLE t1(x INTEGER PRIMARY KEY); \
   312    312       ATTACH DATABASE '${otherDataSource}' AS ${otherDbName}; \
................................................................................
   338    338   ###############################################################################
   339    339   
   340    340   runTest {test tkt-343d392b51-3.2 {adapter, attached db, table names} -setup {
   341    341     setupDb [set fileName tkt-343d392b51-3.2.db]
   342    342     set otherFileName tkt-343d392b51-3.2-otherDb.db
   343    343   } -body {
   344    344     set id [object invoke Interpreter.GetActive NextId]
   345         -  set dataSource [file join [getTemporaryPath] $fileName]
   346         -  set otherDataSource [file join [getTemporaryPath] $otherFileName]
          345  +  set dataSource [file join [getDatabaseDirectory] $fileName]
          346  +  set otherDataSource [file join [getDatabaseDirectory] $otherFileName]
   347    347     set otherDbName otherDb
   348    348     set otherTable [appendArgs $otherDbName .t1]
   349    349   
   350    350     set sql(inserts) ""
   351    351     set sql(1) [subst { \
   352    352       CREATE TABLE t1(x INTEGER PRIMARY KEY); \
   353    353       ATTACH DATABASE '${otherDataSource}' AS ${otherDbName}; \

Changes to Tests/tkt-448d663d11.eagle.

    31     31   {delete}}
    32     32   
    33     33   ###############################################################################
    34     34   
    35     35   runTest {test tkt-448d663d11-1.2 {missing journal mode, WAL db} -body {
    36     36     set fileName tkt-448d663d11-1.2.db
    37     37     file copy -force [file join $path wal.db] \
    38         -      [file join [getTemporaryPath] $fileName]
           38  +      [file join [getDatabaseDirectory] $fileName]
    39     39     setupDb $fileName "" "" "" "" false
    40     40     sql execute -execute scalar $db "PRAGMA journal_mode;"
    41     41   } -cleanup {
    42     42     cleanupDb $fileName
    43     43     unset -nocomplain db fileName
    44     44   } -constraints \
    45     45   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
    46     46   {wal}}
    47     47   
    48     48   ###############################################################################
    49     49   
    50     50   runTest {test tkt-448d663d11-1.3 {missing journal mode, non-WAL db} -body {
    51     51     set fileName tkt-448d663d11-1.3.db
    52     52     file copy -force [file join $path nonWal.db] \
    53         -      [file join [getTemporaryPath] $fileName]
           53  +      [file join [getDatabaseDirectory] $fileName]
    54     54     setupDb $fileName "" "" "" "" false
    55     55     sql execute -execute scalar $db "PRAGMA journal_mode;"
    56     56   } -cleanup {
    57     57     cleanupDb $fileName
    58     58     unset -nocomplain db fileName
    59     59   } -constraints \
    60     60   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
    73     73   {delete}}
    74     74   
    75     75   ###############################################################################
    76     76   
    77     77   runTest {test tkt-448d663d11-1.5 {'Default' journal mode, WAL db} -body {
    78     78     set fileName tkt-448d663d11-1.5.db
    79     79     file copy -force [file join $path wal.db] \
    80         -      [file join [getTemporaryPath] $fileName]
           80  +      [file join [getDatabaseDirectory] $fileName]
    81     81     setupDb $fileName Default "" "" "" false
    82     82     sql execute -execute scalar $db "PRAGMA journal_mode;"
    83     83   } -cleanup {
    84     84     cleanupDb $fileName
    85     85     unset -nocomplain db fileName
    86     86   } -constraints \
    87     87   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
    88     88   {wal}}
    89     89   
    90     90   ###############################################################################
    91     91   
    92     92   runTest {test tkt-448d663d11-1.6 {'Default' journal mode, non-WAL db} -body {
    93     93     set fileName tkt-448d663d11-1.6.db
    94     94     file copy -force [file join $path nonWal.db] \
    95         -      [file join [getTemporaryPath] $fileName]
           95  +      [file join [getDatabaseDirectory] $fileName]
    96     96     setupDb $fileName Default "" "" "" false
    97     97     sql execute -execute scalar $db "PRAGMA journal_mode;"
    98     98   } -cleanup {
    99     99     cleanupDb $fileName
   100    100     unset -nocomplain db fileName
   101    101   } -constraints \
   102    102   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
   115    115   {delete}}
   116    116   
   117    117   ###############################################################################
   118    118   
   119    119   runTest {test tkt-448d663d11-1.8 {'Delete' journal mode, WAL db} -body {
   120    120     set fileName tkt-448d663d11-1.8.db
   121    121     file copy -force [file join $path wal.db] \
   122         -      [file join [getTemporaryPath] $fileName]
          122  +      [file join [getDatabaseDirectory] $fileName]
   123    123     setupDb $fileName Delete "" "" "" false
   124    124     sql execute -execute scalar $db "PRAGMA journal_mode;"
   125    125   } -cleanup {
   126    126     cleanupDb $fileName
   127    127     unset -nocomplain db fileName
   128    128   } -constraints \
   129    129   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
   130    130   {delete}}
   131    131   
   132    132   ###############################################################################
   133    133   
   134    134   runTest {test tkt-448d663d11-1.9 {'Delete' journal mode, non-WAL db} -body {
   135    135     set fileName tkt-448d663d11-1.9.db
   136    136     file copy -force [file join $path nonWal.db] \
   137         -      [file join [getTemporaryPath] $fileName]
          137  +      [file join [getDatabaseDirectory] $fileName]
   138    138     setupDb $fileName Delete "" "" "" false
   139    139     sql execute -execute scalar $db "PRAGMA journal_mode;"
   140    140   } -cleanup {
   141    141     cleanupDb $fileName
   142    142     unset -nocomplain db fileName
   143    143   } -constraints \
   144    144   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
   205    205   {wal}}
   206    206   
   207    207   ###############################################################################
   208    208   
   209    209   runTest {test tkt-448d663d11-1.15 {'Wal' journal mode, non-WAL db} -body {
   210    210     set fileName tkt-448d663d11-1.15.db
   211    211     file copy -force [file join $path nonWal.db] \
   212         -      [file join [getTemporaryPath] $fileName]
          212  +      [file join [getDatabaseDirectory] $fileName]
   213    213     setupDb $fileName Wal "" "" "" false
   214    214     sql execute -execute scalar $db "PRAGMA journal_mode;"
   215    215   } -cleanup {
   216    216     cleanupDb $fileName
   217    217     unset -nocomplain db fileName
   218    218   } -constraints \
   219    219   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
   220    220   {wal}}
   221    221   
   222    222   ###############################################################################
   223    223   
   224    224   runTest {test tkt-448d663d11-1.16 {'Wal' journal mode, WAL db} -body {
   225    225     set fileName tkt-448d663d11-1.16.db
   226    226     file copy -force [file join $path wal.db] \
   227         -      [file join [getTemporaryPath] $fileName]
          227  +      [file join [getDatabaseDirectory] $fileName]
   228    228     setupDb $fileName Wal "" "" "" false
   229    229     sql execute -execute scalar $db "PRAGMA journal_mode;"
   230    230   } -cleanup {
   231    231     cleanupDb $fileName
   232    232     unset -nocomplain db fileName
   233    233   } -constraints \
   234    234   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
   247    247   {delete}}
   248    248   
   249    249   ###############################################################################
   250    250   
   251    251   runTest {test tkt-448d663d11-1.18 {'Bad' journal mode, non-WAL db} -body {
   252    252     set fileName tkt-448d663d11-1.18.db
   253    253     file copy -force [file join $path nonWal.db] \
   254         -      [file join [getTemporaryPath] $fileName]
          254  +      [file join [getDatabaseDirectory] $fileName]
   255    255     setupDb $fileName Bad "" "" "" false
   256    256     sql execute -execute scalar $db "PRAGMA journal_mode;"
   257    257   } -cleanup {
   258    258     cleanupDb $fileName
   259    259     unset -nocomplain db fileName
   260    260   } -constraints \
   261    261   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
................................................................................
   262    262   {delete}}
   263    263   
   264    264   ###############################################################################
   265    265   
   266    266   runTest {test tkt-448d663d11-1.19 {'Bad' journal mode, WAL db} -body {
   267    267     set fileName tkt-448d663d11-1.19.db
   268    268     file copy -force [file join $path wal.db] \
   269         -      [file join [getTemporaryPath] $fileName]
          269  +      [file join [getDatabaseDirectory] $fileName]
   270    270     setupDb $fileName Bad "" "" "" false
   271    271     sql execute -execute scalar $db "PRAGMA journal_mode;"
   272    272   } -cleanup {
   273    273     cleanupDb $fileName
   274    274     unset -nocomplain db fileName
   275    275   } -constraints \
   276    276   {eagle monoBug28 command.sql compile.DATA SQLite System.Data.SQLite} -result \
   277    277   {wal}}
   278    278   
   279    279   ###############################################################################
   280    280   
   281    281   runSQLiteTestEpilogue
   282    282   runTestEpilogue

Changes to Tests/tkt-7e3fa93744.eagle.

    58     58   
    59     59   ###############################################################################
    60     60   
    61     61   runTest {test tkt-7e3fa93744-1.2 {composite primary key, DataTable} -setup {
    62     62     setupDb [set fileName tkt-7e3fa93744-1.2.db]
    63     63   } -body {
    64     64     set id [object invoke Interpreter.GetActive NextId]
    65         -  set dataSource [file join [getTemporaryPath] $fileName]
           65  +  set dataSource [file join [getDatabaseDirectory] $fileName]
    66     66   
    67     67     set sql { \
    68     68       CREATE TABLE t1 ( \
    69     69         id1 INTEGER PRIMARY KEY NOT NULL \
    70     70       ); \
    71     71       CREATE TABLE t2 ( \
    72     72         id1 INTEGER NOT NULL, \

Changes to Tests/tkt-e1b2e0f769.eagle.

    27     27     sql execute $db "CREATE TABLE t2(x INTEGER);"
    28     28   
    29     29     foreach x [list 1 2 3] {
    30     30       sql execute $db "INSERT INTO t1 (x) VALUES($x);"
    31     31     }
    32     32   
    33     33     set result1 [list]
    34         -  set dataSource [file join [getTemporaryPath] tkt-e1b2e0f769-1.1.db]
           34  +  set dataSource [file join [getDatabaseDirectory] tkt-e1b2e0f769-1.1.db]
    35     35   
    36     36     foreach table [list t1 t2] {
    37     37       set id [object invoke Interpreter.GetActive NextId]
    38     38       set sql "SELECT x FROM $table ORDER BY x;"
    39     39   
    40     40       unset -nocomplain results errors
    41     41   

Changes to Tests/tkt-e30b820248.eagle.

    24     24   
    25     25   ###############################################################################
    26     26   
    27     27   runTest {test tkt-e30b820248-1.1 {disposal ordering} -setup {
    28     28     set fileName tkt-e30b820248-1.1.db
    29     29   } -body {
    30     30     set id [object invoke Interpreter.GetActive NextId]
    31         -  set dataSource [file join [getTemporaryPath] $fileName]
           31  +  set dataSource [file join [getDatabaseDirectory] $fileName]
    32     32     set name [file rootname [file tail $fileName]]
    33     33   
    34     34     set sql { \
    35     35       CREATE TABLE t1 (id1 INTEGER); \
    36     36       INSERT INTO t1 (id1) VALUES (1); \
    37     37       INSERT INTO t1 (id1) VALUES (2); \
    38     38       INSERT INTO t1 (id1) VALUES (?); \
................................................................................
   120    120   
   121    121     #############################################################################
   122    122   
   123    123     runTest {test [appendArgs tkt-e30b820248-1. $i] {disposal ordering} -setup {
   124    124       set fileName [appendArgs tkt-e30b820248-1. $i .db]
   125    125     } -body {
   126    126       set id [object invoke Interpreter.GetActive NextId]
   127         -    set dataSource [file join [getTemporaryPath] $fileName]
          127  +    set dataSource [file join [getDatabaseDirectory] $fileName]
   128    128       set name [file rootname [file tail $fileName]]
   129    129   
   130    130       set sql { \
   131    131         CREATE TABLE t1 (id1 INTEGER); \
   132    132         INSERT INTO t1 (id1) VALUES (1); \
   133    133         INSERT INTO t1 (id1) VALUES (2); \
   134    134         INSERT INTO t1 (id1) VALUES (3); \

Changes to test/Program.cs.

    30     30                   {
    31     31                       // do nothing.
    32     32                   }
    33     33   
    34     34                   Debugger.Break();
    35     35               }
    36     36   
           37  +            string fileName = "test.db"; // NOTE: New default, was "Test.db3".
    37     38               bool autoRun = false;
    38     39   
    39         -            if ((args != null) && (args.Length > 0))
           40  +            if (args != null)
    40     41               {
    41         -                string arg = args[0];
           42  +                int length = args.Length;
    42     43   
    43         -                if (arg != null)
           44  +                for (int index = 0; index < length; index++)
    44     45                   {
    45         -                    arg = arg.TrimStart(new char[] { '-', '/' });
           46  +                    string arg = args[index];
    46     47   
    47         -                    if (String.Equals(arg, "autoRun",
    48         -                            StringComparison.OrdinalIgnoreCase))
           48  +                    if (arg != null)
    49     49                       {
    50         -                        autoRun = true;
           50  +                        arg = arg.TrimStart(new char[] { '-', '/' });
           51  +
           52  +                        if (String.Equals(arg, "fileName",
           53  +                                StringComparison.OrdinalIgnoreCase))
           54  +                        {
           55  +                            index++;
           56  +
           57  +                            if (index < length)
           58  +                                fileName = args[index];
           59  +                        }
           60  +                        else if (String.Equals(arg, "autoRun",
           61  +                                StringComparison.OrdinalIgnoreCase))
           62  +                        {
           63  +                            autoRun = true;
           64  +                        }
    51     65                       }
    52     66                   }
    53     67               }
    54     68   
    55         -            Application.Run(new TestCasesDialog(autoRun));
           69  +            Application.Run(new TestCasesDialog(fileName, autoRun));
    56     70           }
    57     71       }
    58     72   }

Changes to test/TestCasesDialog.cs.

    28     28       /// If set, then automatically run all the tests and exit.
    29     29       /// </summary>
    30     30       private bool _autoRun;
    31     31   
    32     32       private TestCases _test;
    33     33       private TestCases _testitems;
    34     34   
    35         -    public TestCasesDialog(bool autoRun)
           35  +    public TestCasesDialog(string fileName, bool autoRun)
    36     36       {
    37     37         InitializeComponent();
    38     38   
    39     39         using (DataTable tbl = DbProviderFactories.GetFactoryClasses())
    40     40         {
    41     41           foreach (DataRow row in tbl.Rows)
    42     42           {
................................................................................
    45     45             if (prov.IndexOf("SQLite", 0, StringComparison.OrdinalIgnoreCase) != -1
    46     46               || prov.IndexOf("SqlClient", 0, StringComparison.OrdinalIgnoreCase) != -1
    47     47               )
    48     48               _provider.Items.Add(prov);
    49     49             if (prov == "System.Data.SQLite") _provider.SelectedItem = prov;
    50     50           }
    51     51         }
    52         -      _connectionString.Items.Add("Data Source=Test.db3;Pooling=true;FailIfMissing=false");
           52  +      _connectionString.Items.Add(String.Format("Data Source={0};Pooling=true;FailIfMissing=false", fileName));
    53     53         _connectionString.Items.Add("Data Source=(local);Initial Catalog=sqlite;Integrated Security=True;Max Pool Size=10");
    54     54         _connectionString.SelectedIndex = 0;
    55     55   
    56     56         _autoRun = autoRun;
    57     57         _testitems = new TestCases();
    58     58         foreach (KeyValuePair<string, bool> pair in _testitems.Tests)
    59     59         {