System.Data.SQLite

Artifact [0ff70d27ca]
Login

Artifact 0ff70d27ca67e3884994f4a500f39dedfab8e83b:


###############################################################################
#
# tkt-b4a7ddc83f.eagle --
#
# Written by Joe Mistachkin.
# Released to the public domain, use at your own risk!
#
###############################################################################

package require Eagle
package require Eagle.Library
package require Eagle.Test

runTestPrologue

###############################################################################

package require System.Data.SQLite.Test
runSQLiteTestPrologue

###############################################################################

#
# NOTE: Make sure that SQLite core library is completely shutdown prior to
#       starting any of the tests in this file.
#
shutdownSQLite $test_channel

###############################################################################

for {set i 1} {$i < 3} {incr i} {
  runTest {test [appendArgs tkt-b4a7ddc83f-1. $i] {logging shutdown} -setup \
      [getAppDomainPreamble {
    proc haveSQLiteObjectCommand {[info args haveSQLiteObjectCommand]} {
      [info body haveSQLiteObjectCommand]
    }

    set appDomainId(1) {[expr {[haveSQLiteObjectCommand] ? \
        [object invoke AppDomain.CurrentDomain Id] : [info appdomain]}]}

    set fileName {[appendArgs tkt-b4a7ddc83f-1. $i .db]}
  }] -body {
    set appDomainId(2) [object invoke AppDomain.CurrentDomain Id]

    package require Eagle.Library
    package require Eagle.Test
    package require System.Data.SQLite.Test

    object load -loadtype File [file join [getBinaryDirectory] \
        System.Data.SQLite.dll]

    object invoke System.Data.SQLite.SQLiteLog Initialize

    list $appDomainId(1) $appDomainId(2) \
        [expr {$appDomainId(1) != $appDomainId(2)}] [setupDb $fileName]
  } -cleanup {
    cleanupDb $fileName

    unset -nocomplain appDomainId db fileName
  } -constraints {eagle command.object monoBug28 command.sql compile.DATA\
compile.ISOLATED_INTERPRETERS SQLite System.Data.SQLite} -isolationLevel \
AppDomain -match regexp -result {^\d+ \d+ True\
System#Data#SQLite#SQLiteConnection#\d+$}}
}

###############################################################################

unset -nocomplain i

###############################################################################

runSQLiteTestEpilogue
runTestEpilogue