System.Data.SQLite
Check-in [87a9203693]
Not logged in

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

Overview
Comment:Fixes to test infrastructure utility routines.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 87a9203693613d578b18efa43952a1dc57949a08
User & Date: mistachkin 2013-12-31 08:35:11
Context
2013-12-31
08:40
Add the ability for the test suite infrastructure to skip loading the 'implicit' (i.e. non-platform/architecture) assemblies. check-in: 123d84e4ef user: mistachkin tags: trunk
08:35
Fixes to test infrastructure utility routines. check-in: 87a9203693 user: mistachkin tags: trunk
07:50
Update version history docs. check-in: 65cfd24266 user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to Tests/common.eagle.

   123    123         } elseif {[info exists ::test_machine] && \
   124    124             [string length $::test_machine] > 0} then {
   125    125           #
   126    126           # NOTE: For native builds, return the platform name corresponding to
   127    127           #       the test machine architecture; otherwise, return an empty
   128    128           #       string.
   129    129           #
   130         -        return [expr {$native ? [machineToPlatform $::test_machine] : ""}]
          130  +        return [expr {
          131  +          $native ? [machineToPlatform $::test_machine] : ""
          132  +        }]
   131    133         } elseif {[info exists ::tcl_platform(machine)]} then {
   132    134           #
   133    135           # NOTE: For native builds, return the platform name corresponding to
   134    136           #       the machine architecture; otherwise, return an empty string.
   135    137           #
   136         -        return [expr {$native ? \
   137         -            [machineToPlatform $::tcl_platform(machine)] : ""}]
          138  +        return [expr {
          139  +          $native ? [machineToPlatform $::tcl_platform(machine)] : ""
          140  +        }]
   138    141         } else {
   139    142           #
   140    143           # NOTE: No machine architecture is available, return an empty string.
   141    144           #
   142    145           return ""
   143    146         }
   144    147       }
................................................................................
   918    921         #       should be called only after the [tryLoadAssembly] procedure has
   919    922         #       been called to probe for the System.Data.SQLite managed assembly
   920    923         #       and the [checkForSQLite] procedure has been called to probe for
   921    924         #       the SQLite native library; otherwise, this procedure will simply
   922    925         #       always return zero.
   923    926         #
   924    927         return [expr {
   925         -          [haveConstraint System.Data.SQLite] && [haveConstraint SQLite]
          928  +        [haveConstraint System.Data.SQLite] && [haveConstraint SQLite]
   926    929         }]
   927    930       }
   928    931   
   929    932       proc matchMachine { platform } {
   930    933         #
   931    934         # NOTE: An empty string for the platform means that the build is not
   932    935         #       [primarily] a native build; therefore, it always matches.
................................................................................
  1340   1343         #       caller.  It contains the database connection handle that will be
  1341   1344         #       used to execute the query used to determine if the named table is
  1342   1345         #       present in that database.
  1343   1346         #
  1344   1347         upvar 1 $varName db
  1345   1348   
  1346   1349         #
  1347         -      # NOTE: Execute the SQL query against the sqlite_master table to check if
  1348         -      #       the named table is present and return non-zero if it is.
         1350  +      # NOTE: Use the sqlite_master table to determine if the named table is
         1351  +      #       present in the database.
  1349   1352         #
  1350         -      return [expr {[sql execute -execute scalar $db \
  1351         -          "SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name = ?;" \
  1352         -          [list param1 String $name]] > 0}]
         1353  +      set sql {
         1354  +        SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name = ?;
         1355  +      }
         1356  +
         1357  +      #
         1358  +      # NOTE: Return non-zero if the named table is present.
         1359  +      #
         1360  +      return [expr {
         1361  +        [sql execute -execute scalar $db $sql [list param1 String $name]] > 0
         1362  +      }]
  1353   1363       }
  1354   1364   
  1355   1365       proc trimSql { sql } {
  1356   1366         return [regsub -all -- {\s+} [string trim $sql] " "]
  1357   1367       }
  1358   1368   
  1359         -    proc executeSql { sql {execute none} {fileName ""} } {
         1369  +    proc executeSql { sql {execute none} {format none} {fileName ""} } {
  1360   1370         if {[string length $fileName] == 0} then {set fileName :memory:}
  1361         -      setupDb $fileName "" "" "" "" "" false false false false memDb
         1371  +      setupDb $fileName "" "" "" "" "" false false false false
  1362   1372   
  1363   1373         try {
  1364         -        return [sql execute -execute $execute $memDb $sql]
         1374  +        return [uplevel 1 [list \
         1375  +            sql execute -execute $execute -format $format $db $sql]]
  1365   1376         } finally {
  1366         -        cleanupDb $fileName memDb false false
         1377  +        cleanupDb $fileName db false false false
  1367   1378         }
  1368   1379       }
  1369   1380   
  1370   1381       proc setupDb {
  1371   1382               fileName {mode ""} {dateTimeFormat ""} {dateTimeKind ""} {flags ""}
  1372   1383               {extra ""} {qualify true} {delete true} {uri false}
  1373   1384               {temporary true} {varName db} } {