System.Data.SQLite
Check-in [26ca8062a7]
Not logged in

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

Overview
Comment:Test suite infrastructure changes to produce cleaner output when globally testing connection flags.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 26ca8062a71e77950414c192da768447e4add2b6
User & Date: mistachkin 2014-01-04 01:23:30
Context
2014-01-04
01:36
More work on connection flags handling in the test suite infrastructure. check-in: aef2b03cf4 user: mistachkin tags: trunk
01:23
Test suite infrastructure changes to produce cleaner output when globally testing connection flags. check-in: 26ca8062a7 user: mistachkin tags: trunk
01:03
Put new connection flags in logical order. Add several new composite connection flags. Update comments. check-in: 133692ee96 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/common.eagle.

  1364   1364   
  1365   1365       proc trimSql { sql } {
  1366   1366         return [regsub -all -- {\s+} [string trim $sql] " "]
  1367   1367       }
  1368   1368   
  1369   1369       proc executeSql { sql {execute none} {format none} {fileName ""} } {
  1370   1370         if {[string length $fileName] == 0} then {set fileName :memory:}
  1371         -      setupDb $fileName "" "" "" "" "" false false false false
         1371  +      setupDb $fileName "" "" "" "" "" false false false false db true
  1372   1372   
  1373   1373         try {
  1374   1374           return [uplevel 1 [list \
  1375   1375               sql execute -execute $execute -format $format $db $sql]]
  1376   1376         } finally {
  1377   1377           cleanupDb $fileName db false false false
  1378   1378         }
  1379   1379       }
  1380   1380   
  1381   1381       proc setupDb {
  1382   1382               fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {flags ""}
  1383   1383               {extra ""} {qualify true} {delete true} {uri false}
  1384         -            {temporary true} {varName db} } {
         1384  +            {temporary true} {varName db} {quiet false} } {
  1385   1385         #
  1386   1386         # NOTE: First, see if our caller has requested an in-memory database.
  1387   1387         #
  1388   1388         set isMemory [isMemoryDb $fileName]
  1389   1389   
  1390   1390         #
  1391   1391         # NOTE: For now, all test databases used by the test suite are placed
................................................................................
  1406   1406           # NOTE: Attempt to delete any pre-existing database with the same file
  1407   1407           #       name.
  1408   1408           #
  1409   1409           if {[catch {file delete $fileName} error]} then {
  1410   1410             #
  1411   1411             # NOTE: We somehow failed to delete the file, report why.
  1412   1412             #
  1413         -          tputs $::test_channel [appendArgs \
  1414         -              "==== WARNING: failed to delete database file \"" $fileName \
  1415         -              "\" during setup, error: " \n\t $error \n]
         1413  +          if {!$quiet} then {
         1414  +            tputs $::test_channel [appendArgs \
         1415  +                "==== WARNING: failed to delete database file \"" $fileName \
         1416  +                "\" during setup, error: " \n\t $error \n]
         1417  +          }
  1416   1418           }
  1417   1419         }
  1418   1420   
  1419   1421         #
  1420   1422         # NOTE: Refer to the specified variable (e.g. "db") in the context of our
  1421   1423         #       caller.  The handle to the opened database will be stored there.
  1422   1424         #
................................................................................
  1470   1472         # NOTE: If there are any global (per test run) connection flags currently
  1471   1473         #       set, use them now (i.e. by combining them with the ones for this
  1472   1474         #       connection).
  1473   1475         #
  1474   1476         if {[info exists ::connection_flags] && \
  1475   1477             [string length $::connection_flags] > 0} then {
  1476   1478           #
  1477         -        # NOTE: Show (and log) that we detected some global connection flags.
         1479  +        # NOTE: Show (and log) that the local and global connection flags.
  1478   1480           #
  1479         -        tputs $::test_channel [appendArgs \
  1480         -            "---- global connection flags detected: " $::connection_flags \n]
         1481  +        if {!$quiet} then {
         1482  +          tputs $::test_channel [appendArgs \
         1483  +              "---- local connection flags are: " $flags \n]
         1484  +
         1485  +          tputs $::test_channel [appendArgs \
         1486  +              "---- global connection flags detected: " $::connection_flags \n]
         1487  +        }
  1481   1488   
  1482   1489           #
  1483   1490           # NOTE: Combine and/or replace the connection flags and then show the
  1484   1491           #       new value.
  1485   1492           #
  1486   1493           set flags [combineFlags $flags $::connection_flags]
  1487   1494   
  1488         -        tputs $::test_channel [appendArgs \
  1489         -            "---- combined connection flags are: " $flags \n]
         1495  +        #
         1496  +        # NOTE: Show (and log) the new effective connection flags.
         1497  +        #
         1498  +        if {!$quiet} then {
         1499  +          tputs $::test_channel [appendArgs \
         1500  +              "---- combined connection flags are: " $flags \n]
         1501  +        }
  1490   1502         }
  1491   1503   
  1492   1504         #
  1493   1505         # NOTE: If our caller specified some SQLiteConnectionFlags, add the
  1494   1506         #       necessary portion of the connection string now.
  1495   1507         #
  1496   1508         if {[string length $flags] > 0} then {

Changes to Tests/stress.eagle.

    58     58       #
    59     59       # NOTE: This should be an in-memory database; therefore, skip attempting
    60     60       #       to delete the underlying database file as that would not make any
    61     61       #       sense.  Also, disable use of "PRAGMA temp_store_directory" when
    62     62       #       setting up the new connection because it is not thread-safe.
    63     63       #
    64     64       uplevel 1 [list setupDb $fileName "" "" "" "" "" false false true false \
    65         -        $varName]
           65  +        $varName true]
    66     66     }
    67     67   
    68     68     #############################################################################
    69     69   
    70     70     proc setupWorkloadFileDb { fileName {varName db} } {
    71     71       #
    72     72       # NOTE: Skip attempting to delete the underlying database file.  Also,
    73     73       #       disable use of "PRAGMA temp_store_directory" when setting up
    74     74       #       the new connection because it is not thread-safe.
    75     75       #
    76     76       uplevel 1 [list setupDb $fileName "" "" "" "" "" true false false false \
    77         -        $varName]
           77  +        $varName true]
    78     78     }
    79     79   
    80     80     #############################################################################
    81     81   
    82     82     proc formatWorkloadResult { index } {
    83     83       set result [appendArgs "---- iterations for workload (" $index "): "]
    84     84