Artifact
f52256c051992899d4142749491140db035d566d:
- File
Tests/tkt-ccfa69fc32.eagle
— part of check-in
[530c121d5f]
at
2014-09-23 02:18:03
on branch trunk
— Centralize most test suite handling of constraints that check for the existence of files.
(user:
mistachkin
size: 3782)
###############################################################################
#
# tkt-ccfa69fc32.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
runSQLiteTestFilesPrologue
###############################################################################
runTest {test tkt-ccfa69fc32-1.1 {LINQ Transaction Scope} -body {
#
# NOTE: Re-copy the reference database file used for this unit test to the
# build directory in case it has been changed by a previous test run.
#
file copy -force $northwindEfDbFile \
[file join [getBuildDirectory] [file tail $northwindEfDbFile]]
set result [list]
foreach add [list false true false] {
set output ""
set code [catch {
testClrExec $testLinqExeFile [list -eventflags Wait -directory \
[file dirname $testLinqExeFile] -nocarriagereturns -stdout output \
-success 0] -efTransaction $add
} error]
tlog "---- BEGIN STDOUT OUTPUT\n"
tlog $output
tlog "\n---- END STDOUT OUTPUT\n"
lappend result $code
if {$code == 0} then {
lappend result [string trim $output]
} else {
lappend result [string trim $error]
}
}
set result
} -cleanup {
unset -nocomplain code output error result add
} -constraints {eagle monoToDo SQLite file_System.Data.SQLite.dll testExec\
file_System.Data.SQLite.Linq.dll file_testlinq.exe file_northwindEF.db} -match \
glob -result {0 {1581 1730 1833 2116 2139} 0\
{System.Data.UpdateException: * --->\
System.Data.SQLite.SQLiteException: constraint failed
UNIQUE constraint failed: Territories.TerritoryID
*} 0 {1 2 3 4 5 6 7 8 9 10 1576 1577 1578 1579 1580 1581 1730 1833 2116 2139}}}
###############################################################################
runTest {test tkt-ccfa69fc32-1.2 {EF6 Transaction Scope} -body {
#
# NOTE: Re-copy the reference database file used for this unit test to the
# build directory in case it has been changed by a previous test run.
#
file copy -force $northwindEfDbFile \
[file join [getBuildDirectory] [file tail $northwindEfDbFile]]
set result [list]
foreach add [list false true false] {
set output ""
set code [catch {
testClrExec $testEf6ExeFile [list -eventflags Wait -directory \
[file dirname $testEf6ExeFile] -nocarriagereturns -stdout output \
-success 0] -efTransaction $add
} error]
tlog "---- BEGIN STDOUT OUTPUT\n"
tlog $output
tlog "\n---- END STDOUT OUTPUT\n"
lappend result $code
if {$code == 0} then {
lappend result [string trim $output]
} else {
lappend result [string trim $error]
}
}
set result
} -cleanup {
unset -nocomplain code output error result add
} -constraints {eagle monoToDo SQLite file_System.Data.SQLite.dll testExec\
file_System.Data.SQLite.EF6.dll file_testef6.exe file_northwindEF.db} -match \
glob -result {0 {1581 1730 1833 2116 2139} 0\
{System.Data.Entity.Core.UpdateException: * --->\
System.Data.SQLite.SQLiteException: constraint failed
UNIQUE constraint failed: Territories.TerritoryID
*} 0 {1 2 3 4 5 6 7 8 9 10 1576 1577 1578 1579 1580 1581 1730 1833 2116 2139}}}
###############################################################################
runSQLiteTestFilesEpilogue
runSQLiteTestEpilogue
runTestEpilogue